amelioration(champs.epci): passe le champs epci au DSFR et l'encapsule dans un fieldset

This commit is contained in:
Martin 2023-08-17 16:43:39 +02:00
parent 6aec12f02f
commit a947457b57
2 changed files with 20 additions and 4 deletions

View file

@ -1,5 +1,9 @@
%label.notice{ for: @champ.code_departement_input_id } Le département de lEPCI
= @form.select :code_departement, departement_options, departement_select_options, required: @champ.required?, id: @champ.code_departement_input_id, class: "width-33-desktop width-100-mobile fr-select"
.fr-fieldset__element
= @form.label "Le département de lEPCI", for: @champ.code_departement_input_id, class: 'fr-label'
= @form.select :code_departement, departement_options, departement_select_options, required: @champ.required?, id: @champ.code_departement_input_id, class: "width-33-desktop width-100-mobile fr-select"
- if @champ.departement?
= @form.label "EPCI", for: @champ.epci_input_id
= @form.select :value, epci_options, epci_select_options, required: @champ.required?, id: @champ.epci_input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile fr-select"
.fr-fieldset__element
.fr-select-group
= @form.label "EPCI", for: @champ.epci_input_id, class: 'fr-label'
= @form.select :value, epci_options, epci_select_options, required: @champ.required?, id: @champ.epci_input_id, aria: { describedby: @champ.describedby_id }, class: "width-33-desktop width-100-mobile fr-select"

View file

@ -22,6 +22,18 @@ class Champs::EpciChamp < Champs::TextChamp
code_departement.present?
end
def dsfr_champ_container
:fieldset
end
def html_label?
false
end
def legend_label?
true
end
def code?
code.present?
end