diff --git a/app/components/editable_champ/editable_champ_component.rb b/app/components/editable_champ/editable_champ_component.rb index c416f6643..2494a3e90 100644 --- a/app/components/editable_champ/editable_champ_component.rb +++ b/app/components/editable_champ/editable_champ_component.rb @@ -12,7 +12,8 @@ class EditableChamp::EditableChampComponent < ApplicationComponent types_without_label = [ TypeDeChamp.type_champs.fetch(:header_section), TypeDeChamp.type_champs.fetch(:explication), - TypeDeChamp.type_champs.fetch(:repetition) + TypeDeChamp.type_champs.fetch(:repetition), + TypeDeChamp.type_champs.fetch(:linked_drop_down_list) ] !types_without_label.include?(@champ.type_champ) end diff --git a/app/components/editable_champ/linked_drop_down_list_component/linked_drop_down_list_component.html.haml b/app/components/editable_champ/linked_drop_down_list_component/linked_drop_down_list_component.html.haml index bbc11174f..cd466d386 100644 --- a/app/components/editable_champ/linked_drop_down_list_component/linked_drop_down_list_component.html.haml +++ b/app/components/editable_champ/linked_drop_down_list_component/linked_drop_down_list_component.html.haml @@ -1,12 +1,19 @@ - if @champ.options? - = @form.select :primary_value, @champ.primary_options, {}, required: @champ.required?, class: 'fr-select', id: @champ.input_id, aria: { describedby: @champ.describedby_id } + .fr-fieldset__element.fr-mb-0 + .fr-select-group + = render EditableChamp::ChampLabelComponent.new form: @form, champ: @champ, seen_at: @seen_at + + = @form.select :primary_value, @champ.primary_options, {}, required: @champ.required?, class: 'fr-select fr-mb-3v', id: @champ.input_id, aria: { describedby: @champ.describedby_id } + - if @champ.has_secondary_options_for_primary? .secondary - = @form.label :secondary_value, for: "#{@champ.input_id}-secondary" do - - sanitize(secondary_label) - - if @champ.drop_down_secondary_description.present? - .notice{ id: "#{@champ.describedby_id}-secondary" } - = render SimpleFormatComponent.new(@champ.drop_down_secondary_description, allow_a: true) - = @form.select :secondary_value, @champ.secondary_options[@champ.primary_value], {}, required: @champ.required?, class: 'fr-select', id: "#{@champ.input_id}-secondary", aria: { describedby: "#{@champ.describedby_id}-secondary" } + .fr-fieldset__element + .fr-select-group + = @form.label :secondary_value, for: "#{@champ.input_id}-secondary", class: 'fr-label' do + - sanitize(secondary_label) + - if @champ.drop_down_secondary_description.present? + .notice{ id: "#{@champ.describedby_id}-secondary" } + = render SimpleFormatComponent.new(@champ.drop_down_secondary_description, allow_a: true) + = @form.select :secondary_value, @champ.secondary_options[@champ.primary_value], {}, required: @champ.required?, class: 'fr-select', id: "#{@champ.input_id}-secondary", aria: { describedby: "#{@champ.describedby_id}-secondary" } - else = @form.hidden_field :secondary_value, value: ''