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" }
|
|
|
|
- @champs_with_pieces_jointes.each do |champ|
|
2024-05-07 16:41:20 +02:00
|
|
|
- champ.piece_justificative_file.with_all_variant_records.each do |attachment|
|
2024-05-03 14:41:17 +02:00
|
|
|
.gallery-item
|
|
|
|
- blob = attachment.blob
|
2024-05-29 10:54:38 +02:00
|
|
|
- if displayable_pdf?(blob)
|
2024-05-03 14:41:17 +02:00
|
|
|
= 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
|
|
|
|
.thumbnail
|
2024-05-29 10:54:38 +02:00
|
|
|
= image_tag(preview_url_for(attachment), loading: :lazy)
|
2024-05-03 14:41:17 +02:00
|
|
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
|
|
|
Visualiser
|
|
|
|
.champ-libelle
|
|
|
|
= champ.libelle.truncate(25)
|
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, truncate: true)
|
2024-04-05 14:25:28 +02:00
|
|
|
|
2024-05-29 10:54:38 +02:00
|
|
|
- elsif displayable_image?(blob)
|
|
|
|
= link_to image_url(blob_url(attachment)), title: "#{champ.libelle} -- #{blob.filename}", data: { src: blob.url }, class: 'gallery-link' do
|
2024-04-08 10:13:05 +02:00
|
|
|
.thumbnail
|
2024-05-29 10:54:38 +02:00
|
|
|
= image_tag(variant_url_for(attachment), loading: :lazy)
|
2024-05-03 14:41:17 +02:00
|
|
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
|
|
|
Visualiser
|
|
|
|
.champ-libelle
|
|
|
|
= champ.libelle.truncate(25)
|
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, truncate: true)
|
|
|
|
|
|
|
|
- else
|
|
|
|
.thumbnail
|
|
|
|
= image_tag('apercu-indisponible.png')
|
|
|
|
.champ-libelle
|
|
|
|
= champ.libelle.truncate(25)
|
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, truncate: true)
|
2024-06-25 11:38:11 +02:00
|
|
|
|
|
|
|
- @dossier.commentaires.map(&:piece_jointe).map(&:attachments).flatten.each do |attachment|
|
|
|
|
.gallery-item
|
|
|
|
- blob = attachment.blob
|
|
|
|
- if displayable_pdf?(blob)
|
|
|
|
= link_to blob.url, id: blob.id, data: { iframe: true, src: blob.url }, class: 'gallery-link', type: blob.content_type, title: "Messagerie -- #{blob.filename}" do
|
|
|
|
.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
|
|
|
|
Messagerie
|
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, truncate: true)
|
|
|
|
|
|
|
|
- elsif displayable_image?(blob)
|
|
|
|
= link_to image_url(blob_url(attachment)), title: "Messagerie -- #{blob.filename}", data: { src: blob.url }, class: 'gallery-link' do
|
|
|
|
.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
|
|
|
|
Messagerie
|
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, truncate: true)
|
|
|
|
|
|
|
|
- else
|
|
|
|
.thumbnail
|
|
|
|
= image_tag('apercu-indisponible.png')
|
|
|
|
.champ-libelle
|
|
|
|
Messagerie
|
|
|
|
= render Attachment::ShowComponent.new(attachment: attachment, truncate: true)
|