amelioration(champs.epci): passe le champs epci au DSFR et l'encapsule dans un fieldset
This commit is contained in:
parent
6aec12f02f
commit
a947457b57
2 changed files with 20 additions and 4 deletions
|
@ -1,5 +1,9 @@
|
||||||
%label.notice{ for: @champ.code_departement_input_id } Le département de l’EPCI
|
.fr-fieldset__element
|
||||||
= @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"
|
= @form.label "Le département de l’EPCI", 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?
|
- if @champ.departement?
|
||||||
= @form.label "EPCI", for: @champ.epci_input_id
|
.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"
|
= @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"
|
||||||
|
|
|
@ -22,6 +22,18 @@ class Champs::EpciChamp < Champs::TextChamp
|
||||||
code_departement.present?
|
code_departement.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def dsfr_champ_container
|
||||||
|
:fieldset
|
||||||
|
end
|
||||||
|
|
||||||
|
def html_label?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def legend_label?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
def code?
|
def code?
|
||||||
code.present?
|
code.present?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue