diff --git a/app/assets/stylesheets/companion_window.scss b/app/assets/stylesheets/companion_window.scss index afe2bc0bd..55a5ee422 100644 --- a/app/assets/stylesheets/companion_window.scss +++ b/app/assets/stylesheets/companion_window.scss @@ -130,8 +130,10 @@ ul { list-style: none; + padding: 0px; li { + margin-left: var(--drawer-content-padding); margin-bottom: 1rem; border-bottom: 1px solid lightgray; } diff --git a/app/components/embed/companion_windows_component.html.erb b/app/components/embed/companion_windows_component.html.erb index 2b4219acf..520afb7ee 100644 --- a/app/components/embed/companion_windows_component.html.erb +++ b/app/components/embed/companion_windows_component.html.erb @@ -90,7 +90,7 @@ Files
No downloads available
diff --git a/app/components/embed/companion_windows_component.rb b/app/components/embed/companion_windows_component.rb index 4aa9b16f1..df898e1e5 100644 --- a/app/components/embed/companion_windows_component.rb +++ b/app/components/embed/companion_windows_component.rb @@ -38,5 +38,12 @@ def requested_by_chromium? false end + + # We use this in the download FileListComponent to determine if we need to group files. + # For example, if a media file has a caption or transcript + # we will want to group the caption with the media file. + def show_headers? + downloadable_files.any? { |file| file.caption? || file.transcript? } + end end end diff --git a/app/components/embed/download/file_list_item_component.html.erb b/app/components/embed/download/file_list_item_component.html.erb index 277695e58..6bf2383b3 100644 --- a/app/components/embed/download/file_list_item_component.html.erb +++ b/app/components/embed/download/file_list_item_component.html.erb @@ -1,3 +1,6 @@ +<% if show_headers && !file.caption? && !file.transcript? %> +