feat(editable_champ.explication): show downloadable AttachedOne

This commit is contained in:
Martin 2023-12-19 09:53:27 +01:00
parent 37e8772eab
commit f7feca5fd1
2 changed files with 4 additions and 0 deletions

View file

@ -1,2 +1,4 @@
class EditableChamp::ExplicationComponent < EditableChamp::EditableChampBaseComponent class EditableChamp::ExplicationComponent < EditableChamp::EditableChampBaseComponent
delegate :type_de_champ, to: :@champ
delegate :notice_explicative, to: :type_de_champ
end end

View file

@ -8,3 +8,5 @@
%button{ type: "button", "aria-controls": dom_id(@champ, :explanation), "aria-expanded": "false", href: dom_id(@champ, :explanation), class: "fr-btn ft-btn--sm fr-btn--secondary" } Lire plus %button{ type: "button", "aria-controls": dom_id(@champ, :explanation), "aria-expanded": "false", href: dom_id(@champ, :explanation), class: "fr-btn ft-btn--sm fr-btn--secondary" } Lire plus
.fr-collapse{ id: dom_id(@champ, :explanation) } .fr-collapse{ id: dom_id(@champ, :explanation) }
= render SimpleFormatComponent.new(@champ.collapsible_explanation_text, allow_a: true) = render SimpleFormatComponent.new(@champ.collapsible_explanation_text, allow_a: true)
- if notice_explicative.attached?
= render Dsfr::DownloadComponent.new(attachment: notice_explicative, virus_not_analyzed: !notice_explicative.virus_scanner.started?, new_tab: true)