2024-04-08 10:23:07 +02:00
|
|
|
- content_for(:title, "Pièces jointes")
|
|
|
|
|
|
|
|
= render partial: "header", locals: { dossier: @dossier }
|
|
|
|
|
|
|
|
.fr-container
|
|
|
|
.gallery{ "data-controller": "lightbox"}
|
|
|
|
- @champs_with_pieces_jointes.each do |champ|
|
|
|
|
- champ.piece_justificative_file.each do |attachment|
|
|
|
|
.gallery-item
|
|
|
|
- blob = attachment.blob
|
2024-04-05 14:25:28 +02:00
|
|
|
- if blob.content_type.in?(AUTHORIZED_PDF_TYPES)
|
|
|
|
= link_to blob.url, id: blob.id, data: { iframe: true, src: blob.url }, class: 'gallery-link', type: blob.content_type, title: "#{champ.libelle} -- #{blob.filename}" do
|
2024-04-08 10:23:07 +02:00
|
|
|
.thumbnail
|
|
|
|
= image_tag("pdf-placeholder.png")
|
|
|
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
|
|
|
Visualiser
|
|
|
|
.champ-libelle
|
|
|
|
= champ.libelle
|
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, new_tab: true)
|
|
|
|
|
2024-04-05 14:25:28 +02:00
|
|
|
- elsif blob.content_type.in?(AUTHORIZED_IMAGE_TYPES)
|
2024-04-08 10:23:07 +02:00
|
|
|
= link_to image_url(blob.url), title: "#{champ.libelle} -- #{blob.filename}", data: { src: blob.url }, class: 'gallery-link' do
|
|
|
|
.thumbnail
|
|
|
|
= image_tag(blob.url)
|
|
|
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
|
|
|
Visualiser
|
|
|
|
.champ-libelle
|
|
|
|
= champ.libelle
|
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, new_tab: true)
|
2024-04-05 14:25:28 +02:00
|
|
|
|
|
|
|
- else
|
|
|
|
.thumbnail
|
|
|
|
= image_tag('apercu-indisponible.png')
|
|
|
|
.champ-libelle
|
|
|
|
= champ.libelle
|
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, new_tab: true)
|