mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
91 lines
3.5 KiB
Plaintext
91 lines
3.5 KiB
Plaintext
<% 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: "hoverable btn #{PageCollection.color}", style: 'width: 100%' do %>
|
|
<i class="material-icons"><%= PageCollection.icon %></i>
|
|
|
|
Unfollow
|
|
<% end %>
|
|
|
|
<% else %>
|
|
<%= link_to follow_page_collection_path(@page_collection), class: "hoverable btn #{PageCollection.color}", style: 'width: 100%' do %>
|
|
<i class="material-icons"><%= PageCollection.icon %></i>
|
|
|
|
Follow for updates
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
<% else %>
|
|
<%= link_to follow_page_collection_path(@page_collection), class: "hoverable btn #{PageCollection.color} disabled", style: 'width: 100%' do %>
|
|
Sign in to follow this Collection
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= render partial: 'page_collections/quick_add' %>
|
|
|
|
<% if user_signed_in? && @page_collection.user == current_user %>
|
|
<div class="card-panel">
|
|
<%= form_for @page_collection do |f| %>
|
|
<div class="input-field">
|
|
<%= f.text_area :description, class: 'materialize-textarea' %>
|
|
<%= f.label :description, 'Collection Description' %>
|
|
<div class="help-text">You can add details for this collection to explain what kinds of pages you'd like it to contain.</div>
|
|
</div>
|
|
<%= f.submit 'Save changes', class: 'btn right blue white-text' %>
|
|
<div class="clearfix"></div>
|
|
|
|
<% end %>
|
|
</div>
|
|
<% else %>
|
|
<% if @page_collection.description? %>
|
|
<div class="card-panel">
|
|
<%= simple_format @page_collection.description %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<div class="grey-text uppercase">In this collection</div>
|
|
<div class="collection">
|
|
<%= link_to @page_collection, class: "collection-item #{PageCollection.color}-text" do %>
|
|
<i class="material-icons left"><%= PageCollection.icon %></i>
|
|
All Pages
|
|
<span class="badge brown-text"><%= @page_collection.accepted_submissions.count %></span>
|
|
<% end %>
|
|
<% @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 %>
|
|
<i class="material-icons left"><%= klass.icon %></i>
|
|
<%= pt.pluralize %>
|
|
<span class="badge white-text"><%= @page_collection.accepted_submissions.where(content_type: pt).count %></span>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="grey-text uppercase">Curator</div>
|
|
<div>
|
|
<%= 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 %>
|
|
</div>
|
|
<br />
|
|
|
|
<% if @page_collection.contributors.any? %>
|
|
<div class="grey-text uppercase">Contributors</div>
|
|
<% @page_collection.contributors.each do |user| %>
|
|
<div>
|
|
<%= 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 %>
|
|
</div>
|
|
<% end %>
|
|
<br />
|
|
<% end %>
|
|
|
|
<% if user_signed_in? && current_user == @page_collection.user %>
|
|
<ul>
|
|
<li><%= link_to pluralize(@page_collection.pending_submissions.count, 'pending submission'), page_collection_pending_submissions_path(page_collection_id: @page_collection.id) %></li>
|
|
<li><%= link_to 'Edit this collection', edit_page_collection_path(@page_collection) %></li>
|
|
</ul>
|
|
<% end %> |