noesya/osuny

View on GitHub
app/views/admin/research/journals/volumes/show.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, @l10n %>

<div class="row">
  <div class="col-md-9">
    <%= render 'admin/application/summary/show', about: @l10n, small: true %>
    <% if @l10n.text.present? %>
      <%= osuny_label Research::Journal::Volume::Localization.human_attribute_name('text') %>
      <%= sanitize @l10n.text %>
    <% end %>
    <% if @l10n.keywords.present? %>
      <%= osuny_label Research::Journal::Volume::Localization.human_attribute_name('keywords') %>
      <p><%= @l10n.keywords %></p>
    <% end %>
    <% if @papers.any? %>
      <%= osuny_panel Research::Journal::Paper.model_name.human(count: 2) do %>
        <div  class="row g-2 mb-3"
              data-sortable 
              data-sort-url="<%= reorder_admin_research_journal_papers_path(journal_id: @journal.id) %>">
              <% @papers.each do |paper| %>
                <div data-id="<%= paper.id %>">
                  <div class="<%= osuny_card_classes(horizontal: true) %>">
                    <%= osuny_thumbnail_localized paper %>
                    <div class="card-body">
                      <%= osuny_published_localized paper %>
                      <%= osuny_link_localized paper, admin_research_journal_paper_path(journal_id: paper.journal, id: paper) %>
                    </div>
                    <div class="card-footer">
                      <i class="<%= Icon::DRAG %> handle"></i>
                    </div>
                  </div>
                </div>
              <% end %>
            </tbody>
          </table>
        </div>
      <% end %>
    <% end %>
  </div>
  <div class="col-md-3">
    <%= render 'admin/application/featured_image/show', about: @l10n, small: true if @l10n.featured_image.attached? %>
    <% if @volume.number.present? %>
      <%= osuny_label Research::Journal::Volume.human_attribute_name('number') %>
      <p><%= @volume.number %></p>
    <% end %>
    <%= osuny_label Research::Journal::Volume::Localization.human_attribute_name('published_at') %>
    <p><%= l @l10n.published_at.to_time, format: :date_with_explicit_month if @l10n.published_at %></p>
    <%= render 'admin/application/meta_description/show', about: @l10n, small: true %>
  </div>
</div>

<% content_for :action_bar_left do %>
  <%= destroy_link @volume %>
  <%= static_link static_admin_research_journal_volume_path(@volume) %>
<% end %>

<% content_for :action_bar_right do %>
  <%= edit_link @volume %>
<% end %>