diff --git a/app/assets/stylesheets/local/oh_audio.scss b/app/assets/stylesheets/local/oh_audio.scss index 6363882a9..3fcb134a2 100644 --- a/app/assets/stylesheets/local/oh_audio.scss +++ b/app/assets/stylesheets/local/oh_audio.scss @@ -198,11 +198,18 @@ } } - .tab-content { + .tab-pane:not(.pdf-transcript) { // hacky, match attribute-table width max-width: ($max-readable-width / 0.67); } + .pdf-transcript object { + // try to make the embed tag kind of take up a lot of space, + // full page of PDF, full screen, sort of kind of. + width: 100%; + height: 120vh; + } + // When we're two column, add more spacer than default @include media-breakpoint-up(lg) { .col-files { diff --git a/app/decorators/oh_audio_work_show_decorator.rb b/app/decorators/oh_audio_work_show_decorator.rb index 3302bb73e..f8cd3980f 100644 --- a/app/decorators/oh_audio_work_show_decorator.rb +++ b/app/decorators/oh_audio_work_show_decorator.rb @@ -30,6 +30,11 @@ def representative_member @representative_member = all_members.find { |m| m.id == model.representative_id } end + def pdf_transcript_member + # For now we're just assuming the first PDF found is it, which is not quite right. TODO. + @pdf_transcript_member = all_members.find { |m| m.leaf_representative&.content_type&.start_with?("application/pdf") } + end + def audio_members @audio_members ||= all_members.select { |m| m.leaf_representative&.content_type&.start_with?("audio/") } end diff --git a/app/views/works/oh_audio_work_show.html.erb b/app/views/works/oh_audio_work_show.html.erb index ff4bc06d6..9a474dfea 100644 --- a/app/views/works/oh_audio_work_show.html.erb +++ b/app/views/works/oh_audio_work_show.html.erb @@ -45,6 +45,12 @@ Transcript + <% elsif decorator.pdf_transcript_member.present? %> + <% end %>