Merge pull request #10367 from demarches-simplifiees/fix-gallery
Correctif galerie : affichage pdf + feature flag sur galerie dans la page demande
This commit is contained in:
commit
311320a513
5 changed files with 28 additions and 19 deletions
|
@ -25,7 +25,7 @@
|
||||||
- elsif blob.content_type.in?(AUTHORIZED_IMAGE_TYPES)
|
- 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
|
= link_to image_url(blob.url), title: "#{champ.libelle} -- #{blob.filename}", data: { src: blob.url }, class: 'gallery-link' do
|
||||||
.thumbnail
|
.thumbnail
|
||||||
= image_tag(blob.url)
|
= image_tag(blob.url, loading: :lazy)
|
||||||
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
||||||
Visualiser
|
Visualiser
|
||||||
.champ-libelle
|
.champ-libelle
|
||||||
|
|
|
@ -1,19 +1,24 @@
|
||||||
.fr-downloads-group
|
.fr-downloads-group
|
||||||
- champ.piece_justificative_file.attachments.each do |attachment|
|
- if !feature_enabled?(:gallery_demande)
|
||||||
%ul
|
%ul
|
||||||
%li= render Attachment::ShowComponent.new(attachment:, new_tab: true, truncate: true)
|
- champ.piece_justificative_file.attachments.each do |attachment|
|
||||||
.gallery-item
|
%li= render Attachment::ShowComponent.new(attachment:, new_tab: true)
|
||||||
- blob = attachment.blob
|
- else
|
||||||
- if blob.content_type.in?(AUTHORIZED_PDF_TYPES)
|
- champ.piece_justificative_file.attachments.each do |attachment|
|
||||||
= 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
|
%ul
|
||||||
.thumbnail
|
%li= render Attachment::ShowComponent.new(attachment:, new_tab: true, truncate: true)
|
||||||
= image_tag("pdf-placeholder.png")
|
.gallery-item
|
||||||
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
- blob = attachment.blob
|
||||||
= 'Visualiser'
|
- 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'
|
||||||
|
|
||||||
- elsif blob.content_type.in?(AUTHORIZED_IMAGE_TYPES)
|
- 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
|
= link_to image_url(blob.url), title: "#{champ.libelle} -- #{blob.filename}", data: { src: blob.url }, class: 'gallery-link' do
|
||||||
.thumbnail
|
.thumbnail
|
||||||
= image_tag(blob.url)
|
= image_tag(blob.url, loading: :lazy)
|
||||||
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
.fr-btn.fr-btn--tertiary.fr-btn--icon-left.fr-icon-eye{ role: :button }
|
||||||
= 'Visualiser'
|
= 'Visualiser'
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
- content_for(:notice_info) do
|
- content_for(:notice_info) do
|
||||||
= render partial: "shared/dossiers/france_connect_informations_notice", locals: { user_information: dossier.user.france_connect_informations.first }
|
= render partial: "shared/dossiers/france_connect_informations_notice", locals: { user_information: dossier.user.france_connect_informations.first }
|
||||||
|
|
||||||
.fr-container.counter-start-header-section.dossier-show.gallery.gallery-demande{ class: class_names("dossier-show-instructeur" => profile =="instructeur"), "data-controller": "lightbox" }
|
.fr-container.counter-start-header-section.dossier-show{ class: class_names('gallery': feature_enabled?(:gallery_demande), 'gallery-demande': feature_enabled?(:gallery_demande), "dossier-show-instructeur" => profile =="instructeur"), "data-controller": "lightbox" }
|
||||||
.fr-grid-row.fr-grid-row--center
|
.fr-grid-row.fr-grid-row--center
|
||||||
.fr-col-12.fr-col-xl-8
|
.fr-col-12.fr-col-xl-8
|
||||||
- if profile == 'instructeur' && dossier.termine_and_accuse_lecture?
|
- if profile == 'instructeur' && dossier.termine_and_accuse_lecture?
|
||||||
|
|
|
@ -32,9 +32,12 @@ Rails.application.config.content_security_policy do |policy|
|
||||||
connect_whitelist << Rails.application.secrets.matomo[:host] if Rails.application.secrets.matomo[:enabled]
|
connect_whitelist << Rails.application.secrets.matomo[:host] if Rails.application.secrets.matomo[:enabled]
|
||||||
policy.connect_src(:self, *connect_whitelist)
|
policy.connect_src(:self, *connect_whitelist)
|
||||||
|
|
||||||
# Frames: allow Matomo's iframe on the /suivi page
|
# Frames: allow some iframes
|
||||||
frame_whitelist = []
|
frame_whitelist = []
|
||||||
|
# allow Matomo's iframe on the /suivi page
|
||||||
frame_whitelist << URI(MATOMO_IFRAME_URL).host if Rails.application.secrets.matomo[:enabled]
|
frame_whitelist << URI(MATOMO_IFRAME_URL).host if Rails.application.secrets.matomo[:enabled]
|
||||||
|
# allow pdf iframes in the PJ gallery
|
||||||
|
frame_whitelist << URI(DS_PROXY_URL).host if DS_PROXY_URL.present?
|
||||||
policy.frame_src(:self, *frame_whitelist)
|
policy.frame_src(:self, *frame_whitelist)
|
||||||
|
|
||||||
# Everything else: allow us
|
# Everything else: allow us
|
||||||
|
|
|
@ -26,6 +26,7 @@ features = [
|
||||||
:engagement_juridique_type_de_champ,
|
:engagement_juridique_type_de_champ,
|
||||||
:export_order_by_revision,
|
:export_order_by_revision,
|
||||||
:expression_reguliere_type_de_champ,
|
:expression_reguliere_type_de_champ,
|
||||||
|
:gallery_demande,
|
||||||
:groupe_instructeur_api_hack,
|
:groupe_instructeur_api_hack,
|
||||||
:hide_instructeur_email,
|
:hide_instructeur_email,
|
||||||
:sva,
|
:sva,
|
||||||
|
|
Loading…
Reference in a new issue