indentlabs/notebook

View on GitHub
app/views/page_collections/index.html.erb

Summary

Maintainability
Test Coverage
<%= 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' %>

<% unless current_user.can_create?(PageCollection) %>
  <div class="card-panel">
    Although anyone can submit their notebook pages to any public collection, creating <em>new</em> Collections is currently limited to Premium subscribers.
    A more widespread release for users without a Premium subscription is coming soon.
    <%= link_to 'Upgrade to create your own Collection', subscription_path %>.
  </div>
<% end %>

<% if @collections_with_pending.any? %>
  <div class="row">
    <%= render partial: 'page_collections/collection_grid', locals: { collection_list: @collections_with_pending, title: "Your collections with pending submissions" } %>
  </div>
<% end %>

<% if @my_collections.any? || current_user.on_premium_plan? || Date.current < 'October 21, 2020'.to_date %>
  <div class="row">
    <%= 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 %>
      <div class="col s12 m6 l4">
        <%= link_to new_page_collection_path do %>
          <div class="card-panel <%= PageCollection.color %> white-text hoverable center" style="height: 246px;">
            <br /><br />

            <i class="material-icons large">add</i><br />
            Create a collection
          </div>
        <% end %>
      </div>
    <% end %>
  </div>
<% end %>

<% if @followed_collections.any? %>
  <div class="row">
    <%= render partial: 'page_collections/collection_grid', locals: { collection_list: @followed_collections, title: "Collections you follow" } %>
  </div>
<% end %>

<% if @network_collections.any? %>
  <div class="row">
    <%= render partial: 'page_collections/collection_grid', locals: { collection_list: @network_collections, title: "Collections from your network" } %>
  </div>
<% end %>

<% if @random_collections.any? %>
  <div class="row">
    <%= render partial: 'page_collections/collection_grid', locals: { collection_list: @random_collections, title: "Discover more collections" } %>
  </div>
<% end %>