2023-06-27 17:38:37 +02:00
|
|
|
.fr-downloads-group
|
2024-04-22 20:55:13 +02:00
|
|
|
- if !feature_enabled?(:gallery_demande)
|
2024-04-08 10:22:45 +02:00
|
|
|
%ul
|
2024-04-22 20:55:13 +02:00
|
|
|
- champ.piece_justificative_file.attachments.each do |attachment|
|
|
|
|
%li= render Attachment::ShowComponent.new(attachment:, new_tab: true)
|
|
|
|
- else
|
2024-04-26 16:47:19 +02:00
|
|
|
.gallery-items-list
|
|
|
|
- champ.piece_justificative_file.attachments.each do |attachment|
|
|
|
|
.gallery-item
|
|
|
|
- blob = attachment.blob
|
|
|
|
- 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
|
|
|
|
.thumbnail
|
|
|
|
= image_tag("pdf-placeholder.png")
|
|
|
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
|
|
|
= 'Visualiser'
|
2024-04-08 10:22:45 +02:00
|
|
|
|
2024-04-26 16:47:19 +02:00
|
|
|
- elsif blob.content_type.in?(AUTHORIZED_IMAGE_TYPES)
|
|
|
|
= link_to image_url(blob.url), title: "#{champ.libelle} -- #{blob.filename}", data: { src: blob.url }, class: 'gallery-link' do
|
|
|
|
.thumbnail
|
|
|
|
= image_tag(attachment.variant(:medium), loading: :lazy)
|
|
|
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
|
|
|
= 'Visualiser'
|
|
|
|
- else
|
2024-04-22 20:55:13 +02:00
|
|
|
.thumbnail
|
2024-04-26 16:47:19 +02:00
|
|
|
= image_tag('apercu-indisponible.png')
|
|
|
|
= render Attachment::ShowComponent.new(attachment:, new_tab: true, truncate: true)
|