From a46ebea4eecaff057b6adafe4012fe96d6cf7019 Mon Sep 17 00:00:00 2001 From: Benoit Queyron Date: Tue, 11 Jun 2024 14:44:25 +0200 Subject: [PATCH] =?UTF-8?q?d=C3=A9tachement=20de=20l'attribut=20for=20dans?= =?UTF-8?q?=20le=20label=20d'une=20PJ=20avec=20l'id=20de=20l'input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../champ_label_component.html.haml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/components/editable_champ/champ_label_component/champ_label_component.html.haml b/app/components/editable_champ/champ_label_component/champ_label_component.html.haml index 0be774df0..76e67c44c 100644 --- a/app/components/editable_champ/champ_label_component/champ_label_component.html.haml +++ b/app/components/editable_champ/champ_label_component/champ_label_component.html.haml @@ -1,8 +1,13 @@ = # we do this trick because some html elements should use 'label' and some should be plain paragraphs - if @champ.html_label? - = @form.label @champ.main_value_name, id: @champ.labelledby_id, for: @champ.input_id, class: 'fr-label' do - - render EditableChamp::ChampLabelContentComponent.new form: @form, champ: @champ, seen_at: @seen_at + - if @champ.piece_justificative? + -# champ piece_justificative : remove the asociation with the input + = @form.label @champ.main_value_name, id: @champ.labelledby_id, class: 'fr-label' do + - render EditableChamp::ChampLabelContentComponent.new form: @form, champ: @champ, seen_at: @seen_at + - else + = @form.label @champ.main_value_name, id: @champ.labelledby_id, for: @champ.input_id, class: 'fr-label' do + - render EditableChamp::ChampLabelContentComponent.new form: @form, champ: @champ, seen_at: @seen_at - elsif @champ.legend_label? %legend.fr-fieldset__legend.fr-text--regular{ id: @champ.labelledby_id }= render EditableChamp::ChampLabelContentComponent.new form: @form, champ: @champ, seen_at: @seen_at - elsif @champ.single_checkbox?