diff --git a/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.en.yml b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.en.yml new file mode 100644 index 000000000..9077e600a --- /dev/null +++ b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.en.yml @@ -0,0 +1,3 @@ +--- +en: + prompt: "Select" \ No newline at end of file diff --git a/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.fr.yml b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.fr.yml new file mode 100644 index 000000000..c6bf71bba --- /dev/null +++ b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.fr.yml @@ -0,0 +1,3 @@ +--- +fr: + prompt: "Sélectionner" \ No newline at end of file diff --git a/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml index 1a16052ed..f3d8007b9 100644 --- a/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml +++ b/app/components/editable_champ/multiple_drop_down_list_component/multiple_drop_down_list_component.html.haml @@ -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' diff --git a/config/locales/models/champs/multiple_drop_down_list/en.yml b/config/locales/models/champs/multiple_drop_down_list/en.yml new file mode 100644 index 000000000..6edaa4169 --- /dev/null +++ b/config/locales/models/champs/multiple_drop_down_list/en.yml @@ -0,0 +1,6 @@ +en: + activerecord: + attributes: + champs/multiple_drop_down_list_champ: + hints: + value: "You can select one or more options." diff --git a/config/locales/models/champs/multiple_drop_down_list/fr.yml b/config/locales/models/champs/multiple_drop_down_list/fr.yml new file mode 100644 index 000000000..5961f4a36 --- /dev/null +++ b/config/locales/models/champs/multiple_drop_down_list/fr.yml @@ -0,0 +1,6 @@ +fr: + activerecord: + attributes: + champs/multiple_drop_down_list_champ: + hints: + value: "Vous pouvez sélectionner un ou plusieurs choix."