-
Pending submissions
+
+ You have <%= pluralize @page_collection_submissions.count, 'pending submission' %>
+ to
+ <%= link_to @page_collection.name, @page_collection, class: "#{PageCollection.color}-text" %>.
+
Submitters will be notified if you accept their content.
@@ -30,18 +34,18 @@
Submitted by
- <%= link_to content.user, class: "#{User.color}-text" do %>
+ <%= link_to content.user, class: "#{User.color}-text text-lighten-3" do %>
<%= content.user.display_name %>
<% end %>
<%= time_ago_in_words page_collection_submission.submitted_at %> ago
- <%= link_to approve_page_collection_submission_path(page_collection_submission), class: 'green-text' do %>
+ <%= link_to approve_page_collection_submission_path(page_collection_submission), class: 'btn green white-text' do %>
check
Approve
<% end %>
- <%= link_to pass_page_collection_submission_path(page_collection_submission), class: 'red-text right' do %>
+ <%= link_to pass_page_collection_submission_path(page_collection_submission), class: 'btn red white-text right' do %>
close
Pass
<% end %>
diff --git a/app/views/page_collection_submissions/show.html.erb b/app/views/page_collection_submissions/show.html.erb
deleted file mode 100644
index 96f36672..00000000
--- a/app/views/page_collection_submissions/show.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-
<%= notice %>
-
-<%= link_to 'Edit', edit_page_collection_submission_path(@page_collection_submission) %> |
-<%= link_to 'Back', page_collection_submissions_path %>
diff --git a/app/views/page_collections/_collection_grid.html.erb b/app/views/page_collections/_collection_grid.html.erb
new file mode 100644
index 00000000..44f6c8c1
--- /dev/null
+++ b/app/views/page_collections/_collection_grid.html.erb
@@ -0,0 +1,25 @@
+
+ <%= PageCollection.icon %>
+ <%= title %>
+
+<% collection_list.each do |collection| %>
+
+ <%= link_to collection do %>
+
+
+ <%= image_tag collection.random_public_image, style: 'max-height: 250px;' %>
+
+ <%= collection.title %>
+
+
+ <% collection.page_types.each do |icon| %>
+ <% klass = icon.constantize %>
+ <%= klass.icon %>
+ <% end %>
+
+
+
+
+ <% end %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/page_collections/_contributor_highlight_bar.html.erb b/app/views/page_collections/_contributor_highlight_bar.html.erb
new file mode 100644
index 00000000..8819d8f2
--- /dev/null
+++ b/app/views/page_collections/_contributor_highlight_bar.html.erb
@@ -0,0 +1,4 @@
+
+ Showing all submitted pages from <%= link_to contributor.display_name, contributor, class: "#{User.color}-text" %>.
+ Click <%= link_to 'here', @page_collection, class: 'blue-text text-lighten-3' %> to see all pages regardless of author.
+
\ No newline at end of file
diff --git a/app/views/page_collections/_form.html.erb b/app/views/page_collections/_form.html.erb
index efd45c57..d6a7f583 100644
--- a/app/views/page_collections/_form.html.erb
+++ b/app/views/page_collections/_form.html.erb
@@ -1,3 +1,8 @@
+<%# react_component("PageCollectionCreationForm", {
+ all_content_types: Rails.application.config.content_types[:all].map(&:name),
+ active_content_types: page_collection.page_types
+}) %>
+
<%= form_with(model: page_collection, local: true) do |f| %>
<% if page_collection.errors.any? %>
@@ -62,7 +67,8 @@
Acceptable pages
- Please check the types of pages you would like to allow in this collection. A small number of page types is recommended.
+ Please check the types of pages you'll allow to be submitted or added to this in this collection. A small number of page types is recommended.
+ You can change this at any time.
diff --git a/app/views/page_collections/_page_type_highlight_bar.html.erb b/app/views/page_collections/_page_type_highlight_bar.html.erb
new file mode 100644
index 00000000..277aa867
--- /dev/null
+++ b/app/views/page_collections/_page_type_highlight_bar.html.erb
@@ -0,0 +1,5 @@
+
+ Showing all submitted <%= page_type.name %> pages.
+
+ Click <%= link_to 'here', @page_collection, class: 'blue-text text-lighten-3' %> to see all pages regardless of type.
+
\ No newline at end of file
diff --git a/app/views/page_collections/_quick_add.html.erb b/app/views/page_collections/_quick_add.html.erb
index e5a70fa4..21e65472 100644
--- a/app/views/page_collections/_quick_add.html.erb
+++ b/app/views/page_collections/_quick_add.html.erb
@@ -1,5 +1,5 @@
<% if user_signed_in? && (@page_collection.allow_submissions? || @page_collection.user == current_user) %>
-
+
-
diff --git a/app/views/page_collections/_sidebar.html.erb b/app/views/page_collections/_sidebar.html.erb
index 4e7145bc..f84aff76 100644
--- a/app/views/page_collections/_sidebar.html.erb
+++ b/app/views/page_collections/_sidebar.html.erb
@@ -88,4 +88,31 @@
- <%= link_to pluralize(@page_collection.pending_submissions.count, 'pending submission'), page_collection_pending_submissions_path(page_collection_id: @page_collection.id) %>
- <%= link_to 'Edit this collection', edit_page_collection_path(@page_collection) %>
-<% end %>
\ No newline at end of file
+<% end %>
+
+
+ -
+ Share collection to...
+
+ -
+ <%= link_to [
+ 'http://twitter.com/share?',
+ 'url=' + URI::escape(page_collection_url(@page_collection)),
+ '&text=' + URI::escape("I'm building a collection of fictional " + @page_collection.page_types.map(&:pluralize).map(&:downcase).to_sentence + " on Notebook.ai. Check it out!")
+ ].join, class: 'blue-text', target: '_blank' do %>
+ share
+ Twitter
+ <% end %>
+
+ -
+ <%=
+ link_to "https://www.facebook.com/sharer/sharer.php?app_id=1523926344336934&u=#{URI::escape(page_collection_url(@page_collection))}&display=popup&ref=plugin&src=share_button",
+ class: 'blue-text',
+ onclick: "return !window.open(this.href, 'Facebook', 'width=640,height=580')" do
+ %>
+ share
+ Facebook
+ <% end %>
+
+
+
\ No newline at end of file
diff --git a/app/views/page_collections/_sort_bar.html.erb b/app/views/page_collections/_sort_bar.html.erb
index 85efde82..6dcdf878 100644
--- a/app/views/page_collections/_sort_bar.html.erb
+++ b/app/views/page_collections/_sort_bar.html.erb
@@ -5,12 +5,20 @@
Trending
<% end %>
-->
- <%= link_to params.permit(:sort).merge({sort: 'alphabetical'}), class: 'btn btn-flat' do %>
+ <%= link_to params.permit(:sort).merge({sort: 'alphabetical'}), class: 'btn btn-flat tooltipped', data: { tooltip: "Show pages in this collection alphabetically, by name" } do %>
sort
Alphabetical
<% end %>
- <%= link_to params.permit(:sort).merge({sort: 'recent'}), class: 'btn btn-flat' do %>
+ <%= link_to params.permit(:sort).merge({sort: 'chronological'}), class: 'btn btn-flat tooltipped', data: { tooltip: "Show pages in this collection in the order they were added" } do %>
+ sort
+ Chronological
+ <% end %>
+ <%= link_to params.permit(:sort).merge({sort: 'recent'}), class: 'btn btn-flat tooltipped', data: { tooltip: "Sort pages in this collection most-recently-added-first" } do %>
sort
Recently added
<% end %>
+ <%= link_to params.permit(:sort).merge({sort: 'shuffle'}), class: 'btn btn-flat tooltipped', data: { tooltip: "Show pages in this collection in a random order" } do %>
+ sort
+ Shuffle
+ <% end %>
\ No newline at end of file
diff --git a/app/views/page_collections/_tiles.html.erb b/app/views/page_collections/_tiles.html.erb
new file mode 100644
index 00000000..fccfd8b4
--- /dev/null
+++ b/app/views/page_collections/_tiles.html.erb
@@ -0,0 +1,62 @@
+
+ <% pages.each do |page| %>
+
+ <% content = page.content %>
+ <% next unless (current_user || User.new).can_read?(content) %>
+
+
+ <%= image_tag content.random_public_image, class: 'activator', style: "height: 300px;" %>
+
+
+
+ <%= link_to content.name, content %>
+ more_vert
+
+
+ Submitted by
+ <%= link_to content.user, class: "#{User.color}-text" do %>
+ <%= content.user.display_name %>
+ <% end %>
+
+
+
+
+ <%= link_to content.name, content %>
+ close
+
+ <% if page.explanation? %>
+
+ <%= simple_format page.explanation %>
+
+ <% end %>
+
+ -
+ <%= link_to content, class: "#{content.class.color}-text" do %>
+ arrow_right
+ View <%= content.name %>'s notebook page
+ <% end %>
+
+ -
+ <%= link_to page_collection_submissions_by_user_path(page_collection_id: @page_collection.id, user_id: page.user_id), class: "#{PageCollection.color}-text" do %>
+ arrow_right
+ View more submissions from this user
+ <% end %>
+
+ -
+ <%= link_to page_collection_submissions_by_user_path(page_collection_id: @page_collection.id, user_id: page.user_id), class: "#{User.color}-text" do %>
+ arrow_right
+ View <%= page.user.display_name %>'s profile
+ <% end %>
+
+ <% if user_signed_in? && current_user == @page_collection.user %>
+ -
+
+ -
+ - <%= 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?" } %>
+ <% end %>
+
+
+
+
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/page_collections/index.html.erb b/app/views/page_collections/index.html.erb
index 10d48c8a..6c097c29 100644
--- a/app/views/page_collections/index.html.erb
+++ b/app/views/page_collections/index.html.erb
@@ -1,33 +1,20 @@
+<%= content_for :full_width_page_header do %>
+ <%= render partial: 'content/components/parallax_header', locals: { content_type: 'PageCollection', content_class: PageCollection, image_only: true } %>
+<% end %>
+
<%= render partial: 'notice_dismissal/messages/15' %>
-<% if @my_collections.any? || current_user.on_premium_plan? %>
+<% if @collections_with_pending.any? %>
-
- <%= PageCollection.icon %>
- Your collections
-
- <% @my_collections.each do |collection| %>
-
- <%= link_to collection do %>
-
-
- <%= image_tag collection.random_public_image, style: 'max-height: 250px;' %>
-
- <%= collection.title %>
-
-
- <% collection.page_types.each do |icon| %>
- <% klass = icon.constantize %>
- <%= klass.icon %>
- <% end %>
-
-
-
-
- <% end %>
-
- <% end %>
- <% if current_user.on_premium_plan? %>
+ <%= render partial: 'page_collections/collection_grid', locals: { collection_list: @collections_with_pending, title: "Your collections with pending submissions" } %>
+
+<% end %>
+
+<% if @my_collections.any? || current_user.on_premium_plan? || Date.current < 'October 21, 2020'.to_date %>
+
+ <%= render partial: 'page_collections/collection_grid', locals: { collection_list: @my_collections, title: "Your collections" } %>
+
+ <% if current_user.on_premium_plan? || Date.current < 'October 21, 2020'.to_date %>
<%= link_to new_page_collection_path do %>
@@ -42,62 +29,20 @@
<% end %>
+<% if @followed_collections.any? %>
+
+ <%= render partial: 'page_collections/collection_grid', locals: { collection_list: @followed_collections, title: "Collections you follow" } %>
+
+<% end %>
+
<% if @network_collections.any? %>
-
- <%= PageCollection.icon %>
- Collections from your network
-
- <% @network_collections.each do |collection| %>
-
- <%= link_to collection do %>
-
-
- <%= image_tag collection.random_public_image, style: 'max-height: 250px;' %>
-
- <%= collection.title %>
-
-
- <% collection.page_types.each do |icon| %>
- <% klass = icon.constantize %>
- <%= klass.icon %>
- <% end %>
-
-
-
-
- <% end %>
-
- <% end %>
+ <%= render partial: 'page_collections/collection_grid', locals: { collection_list: @network_collections, title: "Collections from your network" } %>
<% end %>
<% if @random_collections.any? %>
-
- <%= PageCollection.icon %>
- Discover more collections
-
- <% @random_collections.each do |collection| %>
-
- <%= link_to collection do %>
-
-
- <%= image_tag collection.random_public_image, style: 'max-height: 250px;' %>
-
- <%= collection.title %>
-
-
- <% collection.page_types.each do |icon| %>
- <% klass = icon.constantize %>
- <%= klass.icon %>
- <% end %>
-
-
-
-
- <% end %>
-
- <% end %>
+ <%= render partial: 'page_collections/collection_grid', locals: { collection_list: @random_collections, title: "Discover more collections" } %>
<% end %>
\ No newline at end of file
diff --git a/app/views/page_collections/new.html.erb b/app/views/page_collections/new.html.erb
index 6177ede3..81ec7e3a 100644
--- a/app/views/page_collections/new.html.erb
+++ b/app/views/page_collections/new.html.erb
@@ -1,3 +1,3 @@
-
New Page Collection
+
Create a Collection
<%= render 'form', page_collection: @page_collection %>
diff --git a/app/views/page_collections/show.html.erb b/app/views/page_collections/show.html.erb
index 77c0bbdd..4642056e 100644
--- a/app/views/page_collections/show.html.erb
+++ b/app/views/page_collections/show.html.erb
@@ -1,25 +1,266 @@
<%= content_for :full_width_page_header do %>
<%= render partial: 'content/components/collection_header', locals: { collection: @page_collection } %>
+
+
+
+
+
+
+ <% if user_signed_in? %>
+ <% if current_user != @page_collection.user %>
+ <% if @page_collection.followed_by?(current_user) %>
+ <%= link_to unfollow_page_collection_path(@page_collection), class: "btn #{PageCollection.color} lighten-2 right" do %>
+ <%= PageCollection.icon %>
+ Unfollow
+ <% end %>
+
+ <% else %>
+ <%= link_to follow_page_collection_path(@page_collection), class: "btn #{PageCollection.color} right" do %>
+ <%= PageCollection.icon %>
+ Follow for updates
+ <% end %>
+ <% end %>
+ <% else %>
+ <%= link_to 'Edit collection', edit_page_collection_path(@page_collection), class: 'btn btn-flat right' %>
+
+ <% end %>
+ <% else %>
+ <%= link_to '#', class: "btn #{PageCollection.color} lighten-2 right disabled" do %>
+ <%= PageCollection.icon %>
+ Follow
+ <% end %>
+ <% end %>
+
+ About this collection
+
+
+ <% if user_signed_in? && @page_collection.user == current_user %>
+ <%= form_for @page_collection do |f| %>
+
+ <%= f.submit 'Save changes', class: 'btn right blue white-text' %>
+
+
+ <% end %>
+ <% else %>
+ <% if @page_collection.description? %>
+
+ <%= simple_format @page_collection.description %>
+
+ <% end %>
+ <% end %>
+
+
+
+
+
+
+ <% if user_signed_in? && @page_collection.user_id == current_user.id %>
+ <% if @page_collection.pending_submissions.count > 0 %>
+ <%=
+ link_to page_collection_pending_submissions_path(page_collection_id: @page_collection.id),
+ class: "#{PageCollection.color} white-text btn btn-large",
+ style: "width: 100%" do
+ %>
+
notifications_active
+
+ <%= pluralize(@page_collection.pending_submissions.count, 'pending submission') %>
+
+ <% end %>
+ <% end %>
+ <% end %>
+
+ <%# render partial: 'page_collections/quick_add' %>
+
+ <%= PageCollection.icon %>
+
+ <%= @page_collection.user == current_user ? 'Add' : 'Submit' %> a page
+
+ to this Collection
+
+
+
+
+
+
In this collection
+
+
+ <% @page_collection.page_types.each do |pt| %>
+ <% klass = pt.constantize %>
+ <%= link_to(send(pt.downcase.pluralize + '_page_collection_path', @page_collection), class: "collection-item #{klass.color} white-text") do %>
+ <%= klass.icon %>
+ <%= pt.pluralize %>
+ <%= @page_collection.accepted_submissions.where(content_type: pt).count %>
+ <% end %>
+ <% end %>
+ <%= link_to @page_collection, class: "collection-item #{PageCollection.color}-text" do %>
+ <%= PageCollection.icon %>
+ All Pages
+ <%= @page_collection.accepted_submissions.count %>
+ <% end %>
+
+
+
Curator
+
+ <%= link_to @page_collection.user, class: "#{User.color}-text" do %>
+ <%= image_tag @page_collection.user.image_url(size=20), class: 'left circle', style: 'margin-right: 8px;' %>
+ <%= @page_collection.user.display_name %>
+ <% end %>
+
+
+ <% if @page_collection.contributors.any? %>
+
+
Contributors
+ <% @page_collection.contributors.each do |user| %>
+
+ <%= link_to user, class: "#{User.color}-text" do %>
+ <%= image_tag user.image_url(size=20), class: 'left circle', style: 'margin-right: 8px;' %>
+ <%= user.display_name %>
+ <% end %>
+
+ <% end %>
+
+ <% end %>
+
+
+
+
+
+ <% if @pages.empty? %>
+
+
+
+ This collection doesn't have any approved public pages yet.
+ <% if user_signed_in? %>
+ <% if current_user == @page_collection.user %>
+
+ Add your first page.
+
+ <% else %>
+
+ Yours could be first!
+
+ <% end %>
+ <% else %>
+ Sign in to submit your pages!
+ <% end %>
+
+
+
+ <% else %>
+ <%= render partial: 'page_collections/sort_bar' %>
+ <% if !!@show_contributor_highlight %>
+ <%= render partial: 'page_collections/contributor_highlight_bar', locals: { contributor: @highlighted_contributor } %>
+ <% end %>
+ <% if !!@show_page_type_highlight %>
+ <%= render partial: 'page_collections/page_type_highlight_bar', locals: { page_type: @page_type } %>
+ <% end %>
+ <%= render partial: 'page_collections/tiles', locals: { pages: @pages } %>
+ <% end %>
+
<% end %>
-
-
- <% if @pages.empty? %>
-
- This collection doesn't have any approved public pages yet. Please check back later!
-
- <% else %>
- <%= render partial: 'page_collections/sort_bar' %>
- <% if !!@show_contributor_highlight %>
-
- Showing all submitted pages from <%= link_to @highlighted_contributor.display_name, @highlighted_contributor, class: "#{User.color}-text" %>.
- Click <%= link_to 'here', @page_collection, class: 'blue-text text-lighten-3' %> to see all pages regardless of author.
-
+<%= form_for PageCollectionSubmission.new do |f| %>
+
-
- <%= render partial: 'page_collections/sidebar' %>
-
-
\ No newline at end of file
+<% end %>
\ No newline at end of file
diff --git a/app/views/share_comments/_show.html.erb b/app/views/share_comments/_show.html.erb
index ef7d94a4..3769e8dc 100644
--- a/app/views/share_comments/_show.html.erb
+++ b/app/views/share_comments/_show.html.erb
@@ -6,7 +6,7 @@
- - About Me
- - Recent Activity
+ - About Me
+ - Recent Activity
- Universes
<% if show_collections_tab %>
diff --git a/db/migrate/20201001195046_add_reference_code_to_notifications.rb b/db/migrate/20201001195046_add_reference_code_to_notifications.rb
new file mode 100644
index 00000000..5709c826
--- /dev/null
+++ b/db/migrate/20201001195046_add_reference_code_to_notifications.rb
@@ -0,0 +1,5 @@
+class AddReferenceCodeToNotifications < ActiveRecord::Migration[6.0]
+ def change
+ add_column :notifications, :reference_code, :string
+ end
+end