Skip to content

Commit

Permalink
🧹 Add Hyku::WorkShowPresenter#viewer?
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyf committed Dec 18, 2023
1 parent 5aa5ddb commit dcc9120
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/presenters/hyku/work_show_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def show_pdf_download_button?
show_pdf_download_button.first.to_i.positive?
end

def viewer?
iiif_viewer? || video_embed_viewer? || show_pdf_viewer?
end

def parent_works(current_user = nil)
@parent_works ||= begin
docs = solr_document.load_parent_docs
Expand All @@ -85,8 +89,16 @@ def parent_works(current_user = nil)
end
end

def video_embed_viewer?
extract_video_embed_presence
end

private

def extract_video_embed_presence
solr_document[:video_embed_tesim]&.first&.present?
end

def iiif_media?(presenter: representative_presenter)
presenter.image? || presenter.video? || presenter.audio? || presenter.pdf?
end
Expand Down

0 comments on commit dcc9120

Please sign in to comment.