UNC-Libraries/hy-c

View on GitHub
app/views/hyrax/file_sets/media_display/_image.html.erb

Summary

Maintainability
Test Coverage
<%# [hyc-override] https://github.com/samvera/hyrax/tree/hyrax-v4.0.0/app/views/hyrax/file_sets/media_display/_image.html.erb %>
<% if display_media_download_link?(file_set: file_set) %>
    <div>
      <h2 class="sr-only"><%= t('hyrax.file_set.show.downloadable_content.heading') %></h2>
      <%# [hyc-override] Hide thumbnail when IIIF viewer present %>
      <% if !@presenter.respond_to?(:iiif_viewer?) || !@presenter.iiif_viewer? %>
        <%= document_presenter(file_set)&.thumbnail&.thumbnail_tag(
                    class: "representative-media",
                    alt: "",
                    role: "presentation") %>
      <% end %>
      <%# [hyc-override] Style download link %>
      <%= link_to t('hyrax.file_set.show.downloadable_content.image_link'),
                  hyrax.download_path(file_set),
                  data: { label: file_set.id, work_id: @presenter.id, collection_ids: @presenter.member_of_collection_ids },
                  target: :_blank,
                  class: "btn btn-info",
                  id: "file_download" %>
    </div>
<%# [hyc-override] No thumbnail when not showing download link %>
<%# else %>
    <%# <div> %>
      <%#= document_presenter(file_set)&.thumbnail&.thumbnail_tag(
                    class: "representative-media",
                    alt: "",
                    role: "presentation") %>
    <%# </div> %>
<% end %>