diff --git a/app/components/editable_champ/explication_component.rb b/app/components/editable_champ/explication_component.rb index 8958b0985..daffa3bf9 100644 --- a/app/components/editable_champ/explication_component.rb +++ b/app/components/editable_champ/explication_component.rb @@ -1,2 +1,4 @@ class EditableChamp::ExplicationComponent < EditableChamp::EditableChampBaseComponent + delegate :type_de_champ, to: :@champ + delegate :notice_explicative, to: :type_de_champ end diff --git a/app/components/editable_champ/explication_component/explication_component.html.haml b/app/components/editable_champ/explication_component/explication_component.html.haml index bc7ff4573..7d65c0f62 100644 --- a/app/components/editable_champ/explication_component/explication_component.html.haml +++ b/app/components/editable_champ/explication_component/explication_component.html.haml @@ -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 .fr-collapse{ id: dom_id(@champ, :explanation) } = 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) \ No newline at end of file