Merge pull request #10245 from demarches-simplifiees/US/fix-attestation-link

correctif(lien.attestation): ETQ expert, je souhaite avoir accès à l'attestation même si je ne suis pas instructeur
This commit is contained in:
mfo 2024-04-02 08:14:37 +00:00 committed by GitHub
commit 84f0891a8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 62 additions and 49 deletions

View file

@ -17,12 +17,6 @@ module Instructeurs
after_action :mark_avis_as_read, only: [:avis, :create_avis]
after_action :mark_annotations_privees_as_read, only: [:annotations_privees, :update_annotations]
def attestation
if dossier.attestation.pdf.attached?
redirect_to dossier.attestation.pdf.url, allow_other_host: true
end
end
def extend_conservation
dossier.extend_conservation(1.month)
flash[:notice] = t('views.instructeurs.dossiers.archived_dossier')

View file

@ -20,7 +20,7 @@
- c.with_value do
= simple_format dossier.motivation
- if dossier.attestation.present?
- if dossier.attestation.present? && dossier.attestation.pdf.attached?
= render Dossiers::RowShowComponent.new(label: "Attestation") do |c|
- c.with_value do
= link_to('Voir lattestation', attestation_instructeur_dossier_path(dossier.procedure, dossier), **external_link_attributes)
= render Dsfr::DownloadComponent.new(attachment: dossier.attestation.pdf, name: t(:download_attestation, scope: [:views, :shared, :dossiers, :form]))