2023-06-27 17:38:37 +02:00
|
|
|
.fr-downloads-group
|
2024-09-06 10:46:28 +02:00
|
|
|
- if profile == 'instructeur'
|
2024-04-26 16:47:19 +02:00
|
|
|
.gallery-items-list
|
2024-05-07 16:41:20 +02:00
|
|
|
- champ.piece_justificative_file.attachments.with_all_variant_records.each do |attachment|
|
2024-04-26 16:47:19 +02:00
|
|
|
.gallery-item
|
|
|
|
- blob = attachment.blob
|
2024-05-29 10:54:38 +02:00
|
|
|
- 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: "#{champ.libelle} -- #{sanitize(blob.filename.to_s)}" do
|
2024-04-26 16:47:19 +02:00
|
|
|
.thumbnail
|
2024-05-29 10:54:38 +02:00
|
|
|
= image_tag(preview_url_for(attachment), loading: :lazy)
|
2024-04-26 16:47:19 +02:00
|
|
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
|
|
|
= 'Visualiser'
|
2024-04-08 10:22:45 +02:00
|
|
|
|
2024-05-29 10:54:38 +02:00
|
|
|
- elsif displayable_image?(blob)
|
2024-08-20 15:51:54 +02:00
|
|
|
= link_to image_url(blob_url(attachment)), title: "#{champ.libelle} -- #{sanitize(blob.filename.to_s)}", data: { src: blob.url }, class: 'gallery-link' do
|
2024-04-26 16:47:19 +02:00
|
|
|
.thumbnail
|
2024-05-29 10:54:38 +02:00
|
|
|
= image_tag(variant_url_for(attachment), loading: :lazy)
|
2024-04-26 16:47:19 +02:00
|
|
|
.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)
|
2024-06-11 16:52:14 +02:00
|
|
|
- else
|
|
|
|
%ul
|
|
|
|
- champ.piece_justificative_file.attachments.each do |attachment|
|
|
|
|
%li= render Attachment::ShowComponent.new(attachment:, new_tab: true)
|