UNC-Libraries/hy-c

View on GitHub
app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb

Summary

Maintainability
Test Coverage
<%# [hyc-override] https://github.com/samvera/hyrax/tree/hyrax-v4.0.0/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb %>
<%# [hyc-override] Overriding to make depositor a facet search and not link to user profile %>
<% id = document.id %>
<tr id="document_<%= id %>">
  <td>&nbsp;
    <% if current_user and document.depositor != current_user.user_key %>
      <i class="fa fa-share" />
    <% end %>
  </td>
  <td>
    <div class="media">
      <%= link_to [main_app, document], "class" => "media-left", "aria-hidden" => "true" do %>
        <%= document_presenter(document)&.thumbnail&.thumbnail_tag(
          { class: "d-none d-md-block file_listing_thumbnail", alt: document.title_or_label }, { suppress_link: true }
        ) %>
      <% end %>
      <div class="media-body">
        <p class="media-heading">
          <strong><%= link_to document.title_or_label, [main_app, document], id: "src_copy_link#{id}", class: "#{'document-title' if document.title_or_label == document.label}" %></strong>
          <a href="#" class="small" title="Click for more details"><i id="expand_<%= id %>" class="fa fa-chevron-right"></i></a>
        </p>
        <%= render_other_collection_links(document, @presenter.id) %>
      </div>
    </div>
  </td>
  <td class="text-center"><%= document.date_uploaded %> </td>
  <td class="text-center"></td>
  <td class="text-center">
    <%= render_visibility_link(document) %>
  </td>
  <% if current_user and can? :edit, @collection %>
    <td class="text-center">
      <%= button_for_remove_from_collection @collection, document, label: "Remove", btn_class: "btn-danger btn-sm" %>
    </td>
  <% end %>
</tr>
<tr id="detail_<%= id %>"> <!--  document detail"> -->
  <td colspan="6">
    <dl class="expanded-details row">
      <dt class="col-3 col-lg-2"><%= t('.creator') %></dt>
      <dd class="col-9 col-lg-4"><%= document.creator.to_a.to_sentence %></dd>
      <dt class="col-3 col-lg-2"><%=  t('.depositor') %></dt>
      <%# [hyc-override] Overriding to make depositor a facet search and not link to user profile %>
      <dd class="col-9 col-lg-4"><%= link_to document.depositor, main_app.search_catalog_path(f: { depositor_ssim: [document.depositor]}) %>
      <dt class="col-3 col-lg-2"><%= t('.edit_access') %></dt>
      <dd class="col-9 col-lg-10">
        <% if document.edit_groups.present? %>
          Groups: <%= document.edit_groups.join(', ') %>
          <br />
        <% end %>
        Users: <%= document.edit_people.join(', ') %>
      </dd>
    </dl>
  </td>
</tr>