From 64964284960f80f16b2f302cfebefdfda2ac05e2 Mon Sep 17 00:00:00 2001 From: drusepth Date: Fri, 25 Nov 2022 23:37:27 -0800 Subject: [PATCH] collection#show polish --- app/views/page_collections/show.html.erb | 327 ++++++++++++----------- 1 file changed, 167 insertions(+), 160 deletions(-) diff --git a/app/views/page_collections/show.html.erb b/app/views/page_collections/show.html.erb index 6b86981a..e07b2c61 100644 --- a/app/views/page_collections/show.html.erb +++ b/app/views/page_collections/show.html.erb @@ -1,203 +1,210 @@ <%= content_for :full_width_page_header do %> <%= render partial: 'content/components/collection_header', locals: { collection: @page_collection } %> +<% end %> -
-
-
-
-
- <% 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 %> +
+
+
+
+
+ <% 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 'Edit collection', edit_page_collection_path(@page_collection), class: 'btn btn-flat right' %> + <% 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 '#', 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.text_area :description, class: 'materialize-textarea' %> - <%= f.label :description, 'Collection Description' %> -
You can add details for this collection to explain what kinds of pages you'd like it to contain.
-
- <%= f.submit 'Save changes', class: 'btn right blue white-text' %> -
+ <%= link_to 'Edit collection', edit_page_collection_path(@page_collection), class: 'btn btn-flat right' %> <% end %> <% else %> - <% if @page_collection.description? %> -
- <%= simple_format @page_collection.description %> -
+ <%= 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.text_area :description, class: 'materialize-textarea' %> + <%= f.label :description, 'Collection Description' %> +
You can add details for this collection to explain what kinds of pages you'd like it to contain.
+
+ <%= f.submit 'Save changes', class: 'btn right blue white-text' %> +
- <% 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 %> + <% else %> + <% if @page_collection.description? %> +
+ <%= simple_format @page_collection.description %>
<% 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 = content_class_from_name(pt) %> - <%= 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 %> + <% 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' %> + <% if user_signed_in? %> + + <% else %> + + <% end %> + <%= PageCollection.icon %> +
+ <%= 'Sign in to' unless user_signed_in? %> + <%= @page_collection.user == current_user ? 'Add' : 'Submit' %> a page + + to this Collection + +
+
+

+ +
In this collection
+ +
+ <% @page_collection.page_types.each do |pt| %> + <% klass = content_class_from_name(pt) %> + <%= 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 %> + <% if @page_collection.page_types.count > 1 %> <%= link_to @page_collection, class: "collection-item #{PageCollection.text_color}" do %> <%= PageCollection.icon %> All Pages <%= @page_collection.accepted_submissions.count %> <% end %> -
- -
Curator
-
- <%= link_to @page_collection.user, class: "#{User.text_color}" 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.text_color}" 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! +
Curator
+
+ <%= link_to @page_collection.user, class: "#{User.text_color}" 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.text_color}" 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 published pages yet. + <% if user_signed_in? %> + <% if current_user == @page_collection.user %> + + Publish your first page. + + <% else %> + + Yours could be first! + + <% end %> + <% else %> + Sign in to <%= @page_collection.auto_accept? ? 'add' : 'submit' %> yours! + <% 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 } %> +
+<% 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 %> <%= form_for PageCollectionSubmission.new do |f| %>