Skip to content

Commit

Permalink
Merge pull request #930 from scientist-softserv/i911-video-embed-for-…
Browse files Browse the repository at this point in the history
…themes

🎁 I911 video embed for themes
  • Loading branch information
Shana Moore authored Dec 7, 2023
2 parents d74f423 + 628981c commit b6f0a7c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 56 deletions.
68 changes: 26 additions & 42 deletions app/views/themes/cultural_show/hyrax/base/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,64 +11,48 @@
<div class="panel-body">
<div class="row">
<%= render 'workflow_actions_widget', presenter: @presenter %>
<% if @presenter.iiif_viewer? %>
<div class="col-sm-12 centered-media">
<%= render 'representative_media', presenter: @presenter, viewer: true %>
</div>
<% elsif Flipflop.default_pdf_viewer? && @presenter.show_pdf_viewer? && @presenter.file_set_presenters.any?(&:pdf?) %>
<div class="col-sm-12">
<%= render 'pdf_js', file_set_presenter: pdf_file_set_presenter(@presenter) %>
</div>
<% end %>
<div class="col-sm-12">
<%= render "show_actions", presenter: @presenter %>
</div>
<div class="centered-media <%= !@presenter.iiif_viewer? ? 'col-sm-6 text-center' : '' %>">
<%= render 'representative_media', presenter: @presenter, viewer: false unless @presenter.iiif_viewer? || @presenter.show_pdf_viewer? %>
<% if !@presenter.iiif_viewer? %>
<div>
<br/>
<%= render('download_pdf', presenter: @presenter, file_set_id: @presenter.file_set_presenters.first.id) if @presenter.show_pdf_download_button? %>
<%= render 'citations', presenter: @presenter %>
<!-- analytics_button is disabled until future fix -->
<%#= render 'analytics_button', presenter: @presenter %>
<br/>
</div>
<% if @presenter.video_embed_viewer? %>
<%= render 'video_embed_viewer', presenter: @presenter %>
<% else %>
<% if @presenter.iiif_viewer? %>
<div class="col-sm-12 centered-media">
<%= render 'representative_media', presenter: @presenter, viewer: true %>
</div>
<% elsif @presenter.pdf_viewer? %>
<div class="col-sm-12">
<%= render 'pdf_js', file_set_presenter: pdf_file_set_presenter(@presenter) %>
</div>
<% else %>
<div class="centered-media <%= !@presenter.viewer? ? 'col-sm-6 text-center' : '' %>">
<%= render 'representative_media', presenter: @presenter, viewer: false %>
</div>
<% end %>
<% end %>
</div>
<div class="<%= @presenter.iiif_viewer? ? 'col-sm-8' : 'col-sm-6' %>">
<div class="<%= @presenter.viewer? ? 'col-sm-8' : 'col-sm-8' %>">
<%= render 'work_description', presenter: @presenter %>
<%= render 'metadata', presenter: @presenter %>
</div>
<div class="<%= @presenter.iiif_viewer? ? 'col-sm-4' : 'col-sm-12' %> relationships-container">
<div class="col-sm-12 col-md-4 relationships-container">
<div class='relationships-box'>
<%= render 'relationships', presenter: @presenter %>
<% if @presenter.class == Hyrax::OerPresenter %>
<%= render 'related_items', presenter: @presenter %>
<% end %>
</div>
<% if @presenter.iiif_viewer? %>
<div class="center-block">
<br>
<%= render('download_pdf', presenter: @presenter, file_set_id: @presenter.file_set_presenters.first.id) if @presenter.show_pdf_download_button? %>
<%= render 'citations', presenter: @presenter %>
<!-- analytics_button is disabled until future fix -->
<%= render('download_pdf', presenter: @presenter, file_set_id: @presenter.file_set_presenters.first.id) if @presenter.show_pdf_download_button? %>
<%= render 'citations', presenter: @presenter %>
<!-- analytics_button is disabled until future fix -->
<%#= render 'analytics_button', presenter: @presenter %>
</div>
<% end %>
</div>
<div class="col-sm-12 work-show-items">
<%= render 'items', presenter: @presenter %>
<%# TODO: we may consider adding these partials in the future %>
<%# = render 'sharing_with', presenter: @presenter %>
<%# = render 'user_activity', presenter: @presenter %>
</div>
<span class='hide analytics-event' data-category="work" data-action="work-view" data-name="<%= @presenter.id %>" >
<% @presenter.member_of_collection_ids.each do |collection_id| %>
<span class='hide analytics-event' data-category="work-in-collection" data-action="work-in-collection-view" data-name="<%= collection_id %>" >
<% end %>
</div>
</div>
</div>
<span class='hide analytics-event' data-category="work" data-action="work-view" data-name="<%= @presenter.id %>" >
<% @presenter.member_of_collection_ids.each do |collection_id| %>
<span class='hide analytics-event' data-category="work-in-collection" data-action="work-in-collection-view" data-name="<%= collection_id %>" >
<% end %>
</div>
</div>
</div>
11 changes: 7 additions & 4 deletions app/views/themes/reshare_show/hyrax/base/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@
<div class="panel-body py-0">
<div class="row">
<%= render 'workflow_actions_widget', presenter: @presenter %>
<% if @presenter.iiif_viewer? %>
<% if @presenter.video_embed_viewer? %>
<%= render 'video_embed_viewer', presenter: @presenter %>
<% elsif @presenter.iiif_viewer? %>
<div class="col-sm-12">
<%= render 'representative_media', presenter: @presenter, viewer: true %>
</div>
<% elsif Flipflop.default_pdf_viewer? && @presenter.show_pdf_viewer? && @presenter.file_set_presenters.any?(&:pdf?) %>
<div class="col-sm-12">
<%= render 'pdf_js', file_set_presenter: pdf_file_set_presenter(@presenter) %>
</div>
<% else %>
<div class="col-12 text-center">
<%= render 'representative_media', presenter: @presenter, viewer: false %>
</div>
<% end %>
<div class="col-12 text-center">
<%= render 'representative_media', presenter: @presenter, viewer: false unless @presenter.universal_viewer? || @presenter.show_pdf_viewer? %>
</div>
</div>
<div class="row py-4">
<div class="col-xs-12">
Expand Down
22 changes: 12 additions & 10 deletions app/views/themes/scholarly_show/hyrax/base/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,32 @@
<div class="panel-body">
<div class="row">
<%= render 'workflow_actions_widget', presenter: @presenter %>
<% if @presenter.iiif_viewer? %>
<% if @presenter.video_embed_viewer? %>
<%= render 'video_embed_viewer', presenter: @presenter %>
<div class="col-sm-12">
<div class="image-show-description">
<% render 'work_description', presenter: @presenter %>
</div>
</div>
<% elsif @presenter.iiif_viewer? %>
<div class="col-sm-12 centered-media">
<%= render 'representative_media', presenter: @presenter, viewer: true %>
</div>
<div class="col-sm-12">
<div class="image-show-description">
<%= render 'work_description', presenter: @presenter %>
<% render 'work_description', presenter: @presenter %>
</div>
</div>
<% elsif Flipflop.default_pdf_viewer? && @presenter.show_pdf_viewer? && @presenter.file_set_presenters.any?(&:pdf?) %>
<% elsif @presenter.pdf_viewer? %>
<div class="col-sm-12">
<%= render 'pdf_js', file_set_presenter: pdf_file_set_presenter(@presenter) %>
</div>
<div class="col-sm-12">
<div class="image-show-description">
<%= render 'work_description', presenter: @presenter %>
</div>
</div>
<% else %>
<div class="col-sm-3 mb-1">
<%= render 'representative_media', presenter: @presenter, viewer: false unless @presenter.iiif_viewer? && @presenter.file_set_presenters.any?(&:pdf?) %>
<%= render 'representative_media', presenter: @presenter, viewer: false %>
</div>
<div class="col-sm-9">
<%= render 'work_description', presenter: @presenter %>
<% render 'work_description', presenter: @presenter %>
</div>
<% end %>
</div>
Expand Down

0 comments on commit b6f0a7c

Please sign in to comment.