feat(attachment): allow user to "view" a file without the complete download UI

This commit is contained in:
Colin Darie 2022-12-07 23:04:50 +01:00
parent 7719ce1865
commit 7c5d27d8e9
3 changed files with 30 additions and 4 deletions

View file

@ -9,7 +9,7 @@
- if downloadable?
= render Dsfr::DownloadComponent.new(attachment:)
- else
%span.attachment-filename.fr-mr-1w-= attachment.filename.to_s
%span.attachment-filename.fr-mr-1w= link_to_if(viewable?, attachment.filename.to_s, helpers.url_for(attachment.blob), title: "Ouvrir le fichier #{attachment.filename.to_s}", **helpers.external_link_attributes)
= render Attachment::ProgressComponent.new(attachment: attachment)