fix(gallery): display attachments tab only if attachments in dossier

This commit is contained in:
Eric Leroy-Terquem 2024-05-03 14:41:17 +02:00
parent 479fdb9dbe
commit db8de9e657
No known key found for this signature in database
GPG key ID: ECE60B4C1FA2ABB3
2 changed files with 31 additions and 35 deletions

View file

@ -7,7 +7,7 @@
instructeur_dossier_path(dossier.procedure, dossier),
notification: notifications_summary[:demande])
- if dossier.revision.types_de_champ.any?(&:piece_justificative?)
- if dossier.champs.map(&:piece_justificative_file).flatten.any?
= dynamic_tab_item(t('views.instructeurs.dossiers.tab_steps.attachments'),
pieces_jointes_instructeur_dossier_path(dossier.procedure, dossier))

View file

@ -3,10 +3,6 @@
= render partial: "header", locals: { dossier: @dossier }
.fr-container
- if @champs_with_pieces_jointes.map(&:piece_justificative_file).flatten.none?
.empty-text
Ce dossier ne contient pas de pièces jointes
- else
.gallery.gallery-pieces-jointes{ "data-controller": "lightbox" }
- @champs_with_pieces_jointes.each do |champ|
- champ.piece_justificative_file.each do |attachment|