indentlabs/notebook

View on GitHub
app/views/content/display/_image_card_header.html.erb

Summary

Maintainability
Test Coverage
<div class="parallax-header slider" style="height: 200px;">
  <%= render partial: 'content/display/favorite_control', locals: { content: @content } %>

  <ul class="slides">
    <% @content.public_image_uploads.each do |image_source| %>
      <li>
        <%= image_tag image_source.is_a?(String) ? image_source : image_source.src(:large) %>
        <div class="caption bordered-text center">
          <h3>
            <% if @content.persisted? %>
              <%= link_to @content do %>
                <%= simple_format ContentFormatterService.show(
                  text: @content.name_field_value,
                  viewing_user: current_user
                ) %>
              <% end %>
              <small>
                <%= simple_format ContentFormatterService.show(
                  text: @content.description,
                  viewing_user: current_user
                ) %>
              </small>
            <% else %>
              New <%= @content.class.name %>
            <% end %>
          </h3>
        </div>
      </li>
    <% end %>
    <% @content.basil_commissions.where.not(saved_at: nil).each do |commission| %>
      <li>
        <%= image_tag commission.image %>
        <div class="caption bordered-text center">
          <h3>
            <% if @content.persisted? %>
              <%= link_to @content do %>
                <%= simple_format ContentFormatterService.show(
                  text: @content.name_field_value,
                  viewing_user: current_user
                ) %>
              <% end %>
              <small>
                <%= simple_format ContentFormatterService.show(
                  text: @content.description,
                  viewing_user: current_user
                ) %>
              </small>
            <% else %>
              New <%= @content.class.name %>
            <% end %>
          </h3>
        </div>
      </li>
    <% end %>
  </ul>
</div>