From 9a66a86de94f8e47756ad0a09359ac2be7deb7ab Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Thu, 9 Nov 2023 07:46:28 -0600 Subject: [PATCH] Add a message when no downloadable files are present --- ..._with_companion_windows_component.html.erb | 20 +++++++++++-------- .../media_with_companion_windows_component.rb | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/components/embed/media_with_companion_windows_component.html.erb b/app/components/embed/media_with_companion_windows_component.html.erb index 856ae7039..992d086f0 100644 --- a/app/components/embed/media_with_companion_windows_component.html.erb +++ b/app/components/embed/media_with_companion_windows_component.html.erb @@ -135,14 +135,18 @@
- -
-
    - <%= render Embed::Download::FileListItemComponent.with_collection(viewer.purl_object.downloadable_files) %> -
-
+ <% if downloadable_files.present? %> + +
+
    + <%= render Embed::Download::FileListItemComponent.with_collection(downloadable_files) %> +
+
+ <% else %> +

No downloads available

+ <% end %>
diff --git a/app/components/embed/media_with_companion_windows_component.rb b/app/components/embed/media_with_companion_windows_component.rb index 2eb5d1fd4..45bb4b314 100644 --- a/app/components/embed/media_with_companion_windows_component.rb +++ b/app/components/embed/media_with_companion_windows_component.rb @@ -9,7 +9,7 @@ def initialize(viewer:) attr_reader :viewer delegate :purl_object, to: :viewer - delegate :druid, :citation_only?, :manifest_json_url, to: :purl_object + delegate :druid, :citation_only?, :manifest_json_url, :downloadable_files, to: :purl_object def include_transcripts Settings.enabled_features.transcripts || params[:transcripts] == 'true'