indentlabs/notebook

View on GitHub
app/views/content/components/_collection_header.html.erb

Summary

Maintainability
Test Coverage
<div class="parallax-header slider" style="height: 1px; position: relative; top: -1px">
  <ul class="slides">
    <li>
      <%= image_tag(collection.first_public_image) %>
      <div class="caption center-align bordered-text">
        <%= link_to collection, class: 'white-text' do %>
          <h4>
            <i class="material-icons <%= PageCollection.text_color %>"><%= PageCollection.icon %></i>
            <%= collection.title %>
          </h4>
        <% end %>
        <h5 class="light grey-text text-lighten-3">
          <% if collection.subtitle? %>
            <%= collection.subtitle %>
          <% else %>
            <% collection.page_types.each do |pt| %>
              <% klass = content_class_from_name(pt) %>
              <i class="material-icons <%= klass.text_color %> tooltipped" data-tooltip="This collection contains <%= pt.downcase.pluralize %>"><%= klass.icon %></i>
            <% end %>
          <% end %>
        </h5>
        <% if collection.user.present? %>
          <div>
            A <%= collection.privacy %> collection by <%= link_to collection.user.display_name, collection.user, class: "#{User.text_color}" %>
          </div>
        <% end %>
      </div>
    </li>
  </ul>
</div>