% 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 %>
<%= PageCollection.icon %>
Unfollow
<% end %>
<% else %>
<%= link_to follow_page_collection_path(@page_collection), class: "hoverable btn #{PageCollection.color}", style: 'width: 100%' do %>
<%= PageCollection.icon %>
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 %>
<%= 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 %>
In this collection
<%= link_to @page_collection, class: "collection-item #{PageCollection.text_color}" do %>
<%= PageCollection.icon %>
All Pages
<%= @page_collection.accepted_submissions.count %>
<% end %>
<% @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 %>
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 user_signed_in? && current_user == @page_collection.user %>
- <%= 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 %>
-
Share collection to...
-
<%= link_to [
'http://twitter.com/share?',
'url=' + CGI.escape(page_collection_url(@page_collection)),
'&text=' + CGI.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=#{CGI.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 %>