new collection design with tiles

This commit is contained in:
Andrew Brown 2020-10-01 16:36:52 -07:00
parent 0de4effd60
commit f72e87c4e3
4 changed files with 155 additions and 22 deletions

View File

@ -0,0 +1,45 @@
<div class="row">
<% pages.each do |page| %>
<div class="col s12 m4 l3">
<% content = page.content %>
<% next unless (current_user || User.new).can_read?(content) %>
<div class="hoverable card">
<div class="card-image waves-effect waves-block waves-light">
<%= image_tag content.random_public_image, class: 'activator' %>
</div>
<div class="card-content">
<span class="card-title activator grey-text text-darken-4">
<%= link_to content.name, content %>
<i class="material-icons right">more_vert</i>
</span>
<p>
Submitted by
<%= link_to content.user, class: "#{User.color}-text" do %>
<%= content.user.display_name %>
<% end %>
</p>
</div>
<div class="card-reveal">
<span class="card-title grey-text text-darken-4">
<%= link_to content.name, content %>
<i class="material-icons right">close</i>
</span>
<% if page.explanation? %>
<blockquote>
<%= simple_format page.explanation %>
</blockquote>
<% end %>
<ul>
<li><%= link_to 'View more submissions from this user', page_collection_submissions_by_user_path(page_collection_id: @page_collection.id, user_id: page.user_id) %></li>
<% if user_signed_in? && current_user == @page_collection.user %>
<li>&nbsp;</li>
<li class="divider"></li>
<li>&nbsp;</li>
<li><%= link_to 'Remove from collection', page_collection_submission_path(page), method: :delete, class: 'red-text', data: { confirm: "Are you sure you want to remove this page from this collection?" } %></li>
<% end %>
</ul>
</div>
</div>
</div>
<% end %>
</div>

View File

@ -85,6 +85,7 @@
</div>
<% if @page_collection.contributors.any? %>
<br />
<div class="grey-text uppercase">Contributors</div>
<% @page_collection.contributors.each do |user| %>
<div>
@ -110,26 +111,7 @@
<% if !!@show_contributor_highlight %>
<%= render partial: 'page_collections/contributor_highlight_bar', locals: { contributor: @highlighted_contributor } %>
<% end %>
<%= render partial: 'page_collections/stream', locals: { pages: @pages } %>
<%= render partial: 'page_collections/tiles', locals: { pages: @pages } %>
<% end %>
<% end %>
<div class="row">
<div class="col s12 m9 l8">
<% if @pages.empty? %>
<div class="card-panel">
This collection doesn't have any approved public pages yet. Please check back later!
</div>
<% else %>
<%= render partial: 'page_collections/sort_bar' %>
<% if !!@show_contributor_highlight %>
<%= render partial: 'page_collections/contributor_highlight_bar', locals: { contributor: @highlighted_contributor } %>
<% end %>
<%= render partial: 'page_collections/stream', locals: { pages: @pages } %>
<% end %>
</div>
<div class="col s12 m3 l4">
<%= render partial: 'page_collections/sidebar' %>
</div>
</div>
<% end %>

View File

@ -0,0 +1,5 @@
class AddReferenceCodeToNotifications < ActiveRecord::Migration[6.0]
def change
add_column :notifications, :reference_code, :string
end
end

View File

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_08_29_011900) do
ActiveRecord::Schema.define(version: 2020_10_01_195046) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
@ -41,6 +41,18 @@ ActiveRecord::Schema.define(version: 2020_08_29_011900) do
t.index ["user_id"], name: "index_api_keys_on_user_id"
end
create_table "api_requests", force: :cascade do |t|
t.integer "application_integration_id"
t.integer "integration_authorization_id"
t.string "result"
t.integer "updates_used", default: 0
t.string "ip_address"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["application_integration_id"], name: "index_api_requests_on_application_integration_id"
t.index ["integration_authorization_id"], name: "index_api_requests_on_integration_authorization_id"
end
create_table "application_integrations", force: :cascade do |t|
t.integer "user_id", null: false
t.string "name"
@ -1040,6 +1052,19 @@ ActiveRecord::Schema.define(version: 2020_08_29_011900) do
t.integer "interrogative_count"
t.integer "proper_noun_count"
t.datetime "queued_at"
t.float "linsear_write_grade"
t.float "dale_chall_grade"
t.integer "unique_complex_words_count"
t.integer "unique_simple_words_count"
t.boolean "hate_content_flag", default: false
t.string "hate_trigger_words"
t.boolean "profanity_content_flag", default: false
t.string "profanity_trigger_words"
t.boolean "sex_content_flag", default: false
t.string "sex_trigger_words"
t.boolean "violence_content_flag", default: false
t.string "violence_trigger_words"
t.boolean "adult_content_flag", default: false
t.index ["document_id"], name: "index_document_analyses_on_document_id"
end
@ -1081,6 +1106,19 @@ ActiveRecord::Schema.define(version: 2020_08_29_011900) do
t.index ["entity_type", "entity_id"], name: "index_document_entities_on_entity_type_and_entity_id"
end
create_table "document_revisions", force: :cascade do |t|
t.integer "document_id", null: false
t.string "title"
t.string "body"
t.string "synopsis"
t.integer "universe_id"
t.string "notes_text"
t.datetime "deleted_at"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["document_id"], name: "index_document_revisions_on_document_id"
end
create_table "documents", force: :cascade do |t|
t.integer "user_id"
t.text "body"
@ -1098,6 +1136,61 @@ ActiveRecord::Schema.define(version: 2020_08_29_011900) do
t.index ["user_id"], name: "index_documents_on_user_id"
end
create_table "end_of_day_analytics_reports", force: :cascade do |t|
t.date "day"
t.integer "user_signups"
t.integer "new_monthly_subscriptions"
t.integer "ended_monthly_subscriptions"
t.integer "new_trimonthly_subscriptions"
t.integer "ended_trimonthly_subscriptions"
t.integer "new_annual_subscriptions"
t.integer "ended_annual_subscriptions"
t.integer "paid_paypal_invoices"
t.integer "buildings_created"
t.integer "characters_created"
t.integer "conditions_created"
t.integer "continents_created"
t.integer "countries_created"
t.integer "creatures_created"
t.integer "deities_created"
t.integer "floras_created"
t.integer "foods_created"
t.integer "governments_created"
t.integer "groups_created"
t.integer "items_created"
t.integer "jobs_created"
t.integer "landmarks_created"
t.integer "languages_created"
t.integer "locations_created"
t.integer "lores_created"
t.integer "magics_created"
t.integer "planets_created"
t.integer "races_created"
t.integer "religions_created"
t.integer "scenes_created"
t.integer "schools_created"
t.integer "sports_created"
t.integer "technologies_created"
t.integer "towns_created"
t.integer "traditions_created"
t.integer "universes_created"
t.integer "vehicles_created"
t.integer "documents_created"
t.integer "documents_edited"
t.integer "timelines_created"
t.integer "stream_shares_created"
t.integer "stream_comments"
t.integer "collections_created"
t.integer "collection_submissions_created"
t.integer "thredded_threads_created"
t.integer "thredded_replies_created"
t.integer "thredded_private_messages_created"
t.integer "thredded_private_replies_created"
t.integer "document_analyses_created"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "famous_figureships", force: :cascade do |t|
t.integer "user_id"
t.integer "race_id"
@ -1446,6 +1539,10 @@ ActiveRecord::Schema.define(version: 2020_08_29_011900) do
t.string "ip_address"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "origin"
t.string "content_type"
t.string "user_agent"
t.string "user_token"
t.index ["application_integration_id"], name: "index_integration_authorizations_on_application_integration_id"
t.index ["user_id"], name: "index_integration_authorizations_on_user_id"
end
@ -2143,6 +2240,7 @@ ActiveRecord::Schema.define(version: 2020_08_29_011900) do
t.datetime "updated_at", precision: 6, null: false
t.string "icon_color", default: "blue"
t.string "passthrough_link"
t.string "reference_code"
t.index ["user_id"], name: "index_notifications_on_user_id"
end
@ -3435,6 +3533,8 @@ ActiveRecord::Schema.define(version: 2020_08_29_011900) do
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "api_keys", "users"
add_foreign_key "api_requests", "application_integrations"
add_foreign_key "api_requests", "integration_authorizations"
add_foreign_key "application_integrations", "users"
add_foreign_key "buildings", "universes"
add_foreign_key "buildings", "users"
@ -3567,6 +3667,7 @@ ActiveRecord::Schema.define(version: 2020_08_29_011900) do
add_foreign_key "document_categories", "document_analyses"
add_foreign_key "document_concepts", "document_analyses"
add_foreign_key "document_entities", "document_analyses"
add_foreign_key "document_revisions", "documents"
add_foreign_key "documents", "universes"
add_foreign_key "documents", "users"
add_foreign_key "floras", "universes"