layout: add possibiilty to export outdated pjs

This commit is contained in:
simon lehericey 2024-07-26 10:10:38 +02:00
parent 62b64f5d2d
commit 0dbeb822e4
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5

View file

@ -45,13 +45,33 @@
libelle: ExportTemplate.human_attribute_name(:export_pdf), libelle: ExportTemplate.human_attribute_name(:export_pdf),
prefix: 'export_template[export_pdf]' } prefix: 'export_template[export_pdf]' }
%h3 Pièces justificatives - if procedure.exportables_pieces_jointes_for_all_versions.any?
- procedure.exportables_pieces_jointes.each do |tdc| %h3 Pièces justificatives
- item = export_template.pj(tdc)
= render partial: 'export_item', - procedure.exportables_pieces_jointes.each do |tdc|
locals: { item:, - item = export_template.pj(tdc)
libelle: tdc.libelle, = render partial: 'export_item',
prefix: 'export_template[pjs][]'} locals: { item:,
libelle: tdc.libelle,
prefix: 'export_template[pjs][]'}
- outdated_tdcs = procedure.outdated_exportables_pieces_jointes
- outdated_stable_ids = outdated_tdcs.map(&:stable_id)
- expanded = export_template.pjs.filter(&:enabled?).any? { _1.stable_id.in?(outdated_stable_ids) }
- if outdated_tdcs.any?
%section.fr-accordion.fr-mb-3w
%h3.fr-accordion__title
%button.fr-accordion__btn{ "aria-controls" => "accordion-106", "aria-expanded" => expanded.to_s, "type" => "button" }
pièces justificatives uniquement présentes dans les versions précédentes
.fr-collapse#accordion-106
- outdated_tdcs.each do |tdc|
- item = export_template.pj(tdc)
= render partial: 'export_item',
locals: { item:,
libelle: tdc.libelle,
prefix: 'export_template[pjs][]'}
.fixed-footer .fixed-footer
.fr-container .fr-container