refactor(drop_down_list_champ): other option

This commit is contained in:
Paul Chavard 2021-10-26 20:42:17 +02:00 committed by kara Diaby
parent 8154daf847
commit 7ebc439630
6 changed files with 24 additions and 30 deletions

View file

@ -1,4 +1,4 @@
.drop_down_other{ class: champ.other_value_present? ? '' : 'hidden' }
.notice
%p Veuillez saisir votre autre choix
= form.text_field :value_other, { maxlength: "200", placeholder: "Saisissez ici", disabled: !champ.other_value_present? }
= form.text_field :value_other, maxlength: "200", placeholder: "Saisissez ici", disabled: !champ.other_value_present?

View file

@ -16,7 +16,7 @@
= form.radio_button :value, Champs::DropDownListChamp::OTHER, checked: champ.other_value_present?
Autre
- else
= form.select :value, champ.options, { selected: champ.selected, required: champ.mandatory? }
= form.select :value, champ.options, selected: champ.selected, required: champ.mandatory?
- if champ.drop_down_other?
= render partial: "shared/dossiers/drop_down_other_input", locals: { form: form, champ: champ }