2024-04-08 10:23:07 +02:00
|
|
|
- content_for(:title, "Pièces jointes")
|
|
|
|
|
|
|
|
= render partial: "header", locals: { dossier: @dossier }
|
|
|
|
|
|
|
|
.fr-container
|
2024-05-03 14:41:17 +02:00
|
|
|
.gallery.gallery-pieces-jointes{ "data-controller": "lightbox" }
|
2024-07-02 18:45:41 +02:00
|
|
|
- @attachments_and_libelles.each do |attachment, libelle|
|
2024-06-25 11:38:11 +02:00
|
|
|
.gallery-item
|
|
|
|
- blob = attachment.blob
|
|
|
|
- if displayable_pdf?(blob)
|
2024-08-20 15:51:54 +02:00
|
|
|
= link_to blob.url, id: blob.id, data: { iframe: true, src: blob.url }, class: 'gallery-link', type: blob.content_type, title: "#{libelle} -- #{sanitize(blob.filename.to_s)}" do
|
2024-06-25 11:38:11 +02:00
|
|
|
.thumbnail
|
|
|
|
= image_tag(preview_url_for(attachment), loading: :lazy)
|
|
|
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
|
|
|
Visualiser
|
|
|
|
.champ-libelle
|
2024-07-02 18:45:41 +02:00
|
|
|
= libelle.truncate(25)
|
2024-06-25 11:38:11 +02:00
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, truncate: true)
|
|
|
|
|
|
|
|
- elsif displayable_image?(blob)
|
2024-08-20 15:51:54 +02:00
|
|
|
= link_to image_url(blob_url(attachment)), title: "#{libelle} -- #{sanitize(blob.filename.to_s)}", data: { src: blob.url }, class: 'gallery-link' do
|
2024-06-25 11:38:11 +02:00
|
|
|
.thumbnail
|
|
|
|
= image_tag(variant_url_for(attachment), loading: :lazy)
|
|
|
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
|
|
|
Visualiser
|
|
|
|
.champ-libelle
|
2024-07-02 18:45:41 +02:00
|
|
|
= libelle.truncate(25)
|
2024-06-25 11:38:11 +02:00
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, truncate: true)
|
|
|
|
|
|
|
|
- else
|
|
|
|
.thumbnail
|
|
|
|
= image_tag('apercu-indisponible.png')
|
|
|
|
.champ-libelle
|
2024-07-02 18:45:41 +02:00
|
|
|
= libelle.truncate(25)
|
2024-06-25 11:38:11 +02:00
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, truncate: true)
|