Merge pull request #10220 from demarches-simplifiees/fix-drop-down-missing-hint

ETQ usager : Champ choix multiple, ajouter une aide a a la saisie
This commit is contained in:
mfo 2024-04-02 09:28:34 +00:00 committed by GitHub
commit b245d9b063
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 2 deletions

View file

@ -0,0 +1,3 @@
---
fr:
prompt: "Sélectionner"

View file

@ -11,9 +11,9 @@
- else
%div{ 'data-turbo-focus-group': true }
- if @champ.selected_options.present?
.fr-mb-2w{ "data-turbo": "true" }
.fr-mb-2w.fr-mt-2w{ "data-turbo": "true" }
- @champ.selected_options.each do |option|
= render NestedForms::OwnedButtonComponent.new(formaction: champs_options_path(@champ.id, option:), http_method: :delete, opt: { aria: {pressed: true }, class: 'fr-tag fr-tag-bug fr-mb-1w fr-mr-1w', id: @champ.checkbox_id(option) }) do
= option
- if @champ.unselected_options.present?
= @form.select :value, @champ.unselected_options, { selected: '', include_blank: '' }, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: 'fr-select fr-mt-2v'
= @form.select :value, @champ.unselected_options, { selected: '', include_blank: false, prompt: t('.prompt') }, id: @champ.input_id, aria: { describedby: @champ.describedby_id }, class: 'fr-select fr-mt-2v'

View file

@ -0,0 +1,6 @@
en:
activerecord:
attributes:
champs/multiple_drop_down_list_champ:
hints:
value: "You can select one or more options."

View file

@ -0,0 +1,6 @@
fr:
activerecord:
attributes:
champs/multiple_drop_down_list_champ:
hints:
value: "Vous pouvez sélectionner un ou plusieurs choix."