diff --git a/app/assets/stylesheets/media.scss b/app/assets/stylesheets/media.scss index df7c527df..106cadb0d 100644 --- a/app/assets/stylesheets/media.scss +++ b/app/assets/stylesheets/media.scss @@ -28,7 +28,7 @@ display: flex; justify-content: flex-start; flex-wrap: wrap; - padding: 0.5rem 1.25rem; + padding: 0.5rem var(--bs-card-cap-padding-x); } .media-card-header { @@ -51,7 +51,23 @@ } .card-text-end { - padding: 0.5rem 1.25rem; + padding: 0.75rem var(--bs-card-cap-padding-x); +} + +.media-download-buttons { + display: flex; + flex-direction: column; + align-items: center; + margin: 0.25rem; + justify-content: space-around; +} + +.download-button { + padding: 0 0.5em; + font-size: 0.75em; + width: 3.8em; + height: 1.4em; + border: none; } .mampf-card { diff --git a/app/views/media/medium/_buttons.html.erb b/app/views/media/medium/_buttons.html.erb index 3beeef784..032acb55a 100644 --- a/app/views/media/medium/_buttons.html.erb +++ b/app/views/media/medium/_buttons.html.erb @@ -1,10 +1,9 @@ <% if medium.video.present? %>
- + class="btn btn-secondary" role="button" + target="_blank" title="<%= t('video.play') %>"> +
<% end %> @@ -12,10 +11,9 @@ <% if medium.manuscript.present? %>
- + class="btn btn-secondary" role="button" + target="_blank" title="<%= t('manuscript.view') %>"> +
<% end %> @@ -23,10 +21,9 @@ <% if medium.geogebra.present? %>
- + class="btn btn-secondary" role="button" + target="_blank" title="<%= t('geogebra.view') %>"> +
<% end %> @@ -34,10 +31,9 @@ <% if medium.external_reference_link.present? %>
- + class="btn btn-secondary" role="button" + target="_blank" title="<%= external_link_description_not_empty(medium) %>"> +
<% end %> @@ -45,56 +41,41 @@ <% if medium.sort == 'Quiz' && medium.quiz_graph %>
- + class="btn btn-secondary" role="button" + target="_blank" title="<%= t('quiz.start') %>"> +
<% end %>
- + class="btn btn-secondary" role="button" + title="<%= t('medium.details') %>"> +
-<% if medium.video.present? %> -
+
+ <% if medium.video.present? %> - - - ↓mp4 - - + download="<%= video_download_file(medium) %>" + class="triggerDownload download-button btn btn-secondary" role="button" + data-medium="<%= medium.id %>" + data-sort="video" + title="<%= t('video.download') %>"> + ↓mp4 -
-<% end %> + <% end %> -<% if medium.manuscript.present? %> -
+ <% if medium.manuscript.present? %> - - - ↓pdf - - + download="<%= manuscript_download_file(medium) %>" + class="triggerDownload download-button btn btn-secondary" role="button" + data-medium="<%= medium.id %>" + data-sort="manuscript" + title="<%= t('manuscript.download') %>"> + ↓pdf -
-<% end %> + <% end %> +