From 93c5c52e197cad8d2e47c7056f1d47de3904bc61 Mon Sep 17 00:00:00 2001 From: Julie Salha Date: Tue, 18 Apr 2023 13:43:11 +0200 Subject: [PATCH 1/8] add translations for yes-no radios form and update dsfr styles --- .../yes_no_component/yes_no_component.en.yml | 4 ++++ .../yes_no_component/yes_no_component.fr.yml | 4 ++++ .../yes_no_component.html.haml | 21 ++++++++++++------- 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 app/components/editable_champ/yes_no_component/yes_no_component.en.yml create mode 100644 app/components/editable_champ/yes_no_component/yes_no_component.fr.yml diff --git a/app/components/editable_champ/yes_no_component/yes_no_component.en.yml b/app/components/editable_champ/yes_no_component/yes_no_component.en.yml new file mode 100644 index 000000000..55271e5e3 --- /dev/null +++ b/app/components/editable_champ/yes_no_component/yes_no_component.en.yml @@ -0,0 +1,4 @@ +en: + yes: "Yes" + no: "No" + legend: "Yes/No" diff --git a/app/components/editable_champ/yes_no_component/yes_no_component.fr.yml b/app/components/editable_champ/yes_no_component/yes_no_component.fr.yml new file mode 100644 index 000000000..cb1ee0cfd --- /dev/null +++ b/app/components/editable_champ/yes_no_component/yes_no_component.fr.yml @@ -0,0 +1,4 @@ +fr: + yes: "Oui" + no: "Non" + legend: "Oui/Non" diff --git a/app/components/editable_champ/yes_no_component/yes_no_component.html.haml b/app/components/editable_champ/yes_no_component/yes_no_component.html.haml index 8bb26b90c..013659574 100644 --- a/app/components/editable_champ/yes_no_component/yes_no_component.html.haml +++ b/app/components/editable_champ/yes_no_component/yes_no_component.html.haml @@ -1,8 +1,15 @@ -%fieldset.radios - %label{ for: @champ.yes_input_id } - = @form.radio_button :value, true, id: @champ.yes_input_id - Oui +%fieldset.fr-fieldset + %legend.fr-fieldset__legend.visually-hidden + = t(".legend") - %label{ for: @champ.no_input_id } - = @form.radio_button :value, false, id: @champ.no_input_id - Non + .fr-fieldset__element.fr-fieldset__element--inline + .fr-radio-group + = @form.radio_button :value, false, id: @champ.yes_input_id + %label.fr-label{ for: @champ.yes_input_id } + = t(".yes") + + .fr-fieldset__element.fr-fieldset__element--inline + .fr-radio-group + = @form.radio_button :value, false, id: @champ.no_input_id + %label.fr-label{ for: @champ.no_input_id } + = t(".no") From c37a54b65b4369c023e0541f98c97efbf350beeb Mon Sep 17 00:00:00 2001 From: Julie Salha Date: Tue, 18 Apr 2023 13:51:41 +0200 Subject: [PATCH 2/8] add translations profile identification tokens --- .../api_token_card_component.en.yml | 5 ++++ .../api_token_card_component.fr.yml | 5 ++++ .../api_token_card_component.html.haml | 13 ++++++---- .../api_token_component.en.yml | 16 +++++++++++++ .../api_token_component.fr.yml | 10 ++++++++ .../api_token_component.html.haml | 24 +++++++++++-------- 6 files changed, 58 insertions(+), 15 deletions(-) create mode 100644 app/components/profile/api_token_card_component/api_token_card_component.en.yml create mode 100644 app/components/profile/api_token_card_component/api_token_card_component.fr.yml create mode 100644 app/components/profile/api_token_component/api_token_component.en.yml diff --git a/app/components/profile/api_token_card_component/api_token_card_component.en.yml b/app/components/profile/api_token_card_component/api_token_card_component.en.yml new file mode 100644 index 000000000..ad5a4a5a3 --- /dev/null +++ b/app/components/profile/api_token_card_component/api_token_card_component.en.yml @@ -0,0 +1,5 @@ +en: + tokens_title: API identification tokens + first_paragraph: These tokens are needed to make calls to the + second_paragraph: If you already have applications that use a token and you revoke it, access to the API will be blocked for those applications. + action: Create and display a new token diff --git a/app/components/profile/api_token_card_component/api_token_card_component.fr.yml b/app/components/profile/api_token_card_component/api_token_card_component.fr.yml new file mode 100644 index 000000000..895e269a1 --- /dev/null +++ b/app/components/profile/api_token_card_component/api_token_card_component.fr.yml @@ -0,0 +1,5 @@ +fr: + tokens_title: Jetons d’identification de l’API (token) + first_paragraph: Ces jetons sont nécessaire pour effectuer des appels vers l’API de + second_paragraph: Si vous avez déjà des applications qui utilisent un jeton et vous le révoquez, l’accès à l’API sera bloqué pour ces applications. + action: Créer et afficher un nouveau jeton diff --git a/app/components/profile/api_token_card_component/api_token_card_component.html.haml b/app/components/profile/api_token_card_component/api_token_card_component.html.haml index d74738d1c..63c632e1c 100644 --- a/app/components/profile/api_token_card_component/api_token_card_component.html.haml +++ b/app/components/profile/api_token_card_component/api_token_card_component.html.haml @@ -1,7 +1,11 @@ .card.no-list{ 'data-turbo': 'true', id: dom_id(current_administrateur, :profil_api_token) } - .card-title Jetons d’identification de l’API (token) - %p Ces jetons sont nécessaire pour effectuer des appels vers l’API de #{APPLICATION_NAME}. - %p Si vous avez déjà des applications qui utilisent un jeton et vous le révoquez, l’accès à l’API sera bloqué pour ces applications. + .card-title + = t('.tokens_title') + %p + = t('.first_paragraph') + #{APPLICATION_NAME}. + %p + = t('.second_paragraph') = render Dsfr::ListComponent.new do |list| - api_and_packed_tokens.each do |(api_token, packed_token)| @@ -11,5 +15,4 @@ .fr-card__content = render Profile::APITokenComponent.new(api_token:, packed_token:) - %br - = button_to "Créer et afficher un nouveau jeton", api_tokens_path, method: :post, class: "fr-btn fr-btn--secondary" + = button_to t('.action'), api_tokens_path, method: :post, class: "fr-btn fr-btn--secondary" diff --git a/app/components/profile/api_token_component/api_token_component.en.yml b/app/components/profile/api_token_component/api_token_component.en.yml new file mode 100644 index 000000000..2aa369fc8 --- /dev/null +++ b/app/components/profile/api_token_component/api_token_component.en.yml @@ -0,0 +1,16 @@ +en: + allowed_full_access_html: This token has access to all the procedures attached to your administrator account + allowed_procedures_html: + zero: This token has no access to any process. + one: This token has access to a selected process + other: This token has access to %{count} selected steps + security_one: For security reasons, it will not be re-posted, please note. + security_two: For security reasons, we can only show it to you when it is created. + action_all: Allow access to all procedures + action_choice: Allow access only to selected steps + add: Add + delete: Delete + token_procedures: This token has access to the procedures + revoke_token: Revoke token + reading_writing: Reading and writing + reading: Read only diff --git a/app/components/profile/api_token_component/api_token_component.fr.yml b/app/components/profile/api_token_component/api_token_component.fr.yml index 52bbadc5f..93419d3d4 100644 --- a/app/components/profile/api_token_component/api_token_component.fr.yml +++ b/app/components/profile/api_token_component/api_token_component.fr.yml @@ -4,3 +4,13 @@ fr: zero: Ce jeton n’a accès à aucune démarche one: Ce jeton a accès a une démarche sélectionnée other: Ce jeton a accès a %{count} démarches sélectionnées + security_one: Pour des raisons de sécurité, il ne sera plus ré-affiché, notez-le bien. + security_two: Pour des raisons de sécurité, nous ne pouvons vous l’afficher que lors de sa création. + action_all: Autoriser l’accès a toutes les démarches + action_choice: Autoriser l’accès seulement a des démarches choisies + add: Ajouter + delete: Supprimer + token_procedures: Ce jeton a accès aux démarches + revoke_token: Révoquer le jeton + reading_writing: En lecture et écriture + reading: En lecture seule diff --git a/app/components/profile/api_token_component/api_token_component.html.haml b/app/components/profile/api_token_component/api_token_component.html.haml index 38dd310a1..8ac258e11 100644 --- a/app/components/profile/api_token_component/api_token_component.html.haml +++ b/app/components/profile/api_token_component/api_token_component.html.haml @@ -13,10 +13,12 @@ - button = render Dsfr::CopyButtonComponent.new(text: @packed_token, title: "Copier le jeton dans le presse-papier", success: "Le jeton a été copié dans le presse-papier") = "#{@packed_token} #{button}" - %p Pour des raisons de sécurité, il ne sera plus ré-affiché, notez-le bien. + %p + = t('.security_one') - else - %p Pour des raisons de sécurité, nous ne pouvons vous l’afficher que lors de sa création. + %p + = t('.security_two') - if @api_token.full_access? %p.fr-text--lg @@ -26,33 +28,35 @@ = t('.allowed_procedures_html', count: @api_token.allowed_procedures.size) - if @api_token.allowed_procedures.empty? - = button_to "Autoriser l’accès a toutes les démarches", @api_token, method: :patch, params: { api_token: { disallow_procedure_id: '0' } }, class: "fr-btn fr-btn--secondary" + = button_to t('.action_all'), @api_token, method: :patch, params: { api_token: { disallow_procedure_id: '0' } }, class: "fr-btn fr-btn--secondary" - else %ul - @api_token.allowed_procedures.each do |procedure| %li.flex.justify-between.align-center .truncate-80 = "#{procedure.id} – #{procedure.libelle}" - = button_to "Supprimer", @api_token, method: :patch, params: { api_token: { disallow_procedure_id: procedure.id } }, class: "fr-btn fr-btn--secondary" + = button_to t('.delete'), @api_token, method: :patch, params: { api_token: { disallow_procedure_id: procedure.id } }, class: "fr-btn fr-btn--secondary" .fr-card__end = form_for @api_token, namespace: dom_id(@api_token, :allowed_procedures), html: { class: 'form form-ds-fr-white mb-3', data: { turbo: true } } do |f| = f.label :allowed_procedure_ids do - Autoriser l’accès seulement a des démarches choisies + = t('.action_choice') - @api_token.allowed_procedures.each do |procedure| = f.hidden_field :allowed_procedure_ids, value: procedure.id, multiple: true, id: dom_id(procedure, :allowed_procedure) .flex.justify-between.align-center{ 'data-turbo-force': true } = f.select :allowed_procedure_ids, procedures_to_allow_options, procedures_to_allow_select_options, { class: 'no-margin width-66 small', name: "api_token[allowed_procedure_ids][]" } = f.button type: :submit, class: "fr-btn fr-btn--secondary" do - Ajouter + = t('.add') = form_for @api_token, namespace: dom_id(@api_token, :write_access), html: { class: 'form form-ds-fr-white mb-3', data: { turbo: true, controller: 'autosubmit' } } do |f| = f.label :write_access do - Ce jeton a accès aux démarches + = t('.token_procedures') %label.toggle-switch.no-margin = f.check_box :write_access, class: 'toggle-switch-checkbox' %span.toggle-switch-control.round - %span.toggle-switch-label.on En lecture et écriture - %span.toggle-switch-label.off En lecture seule + %span.toggle-switch-label.on + = t('.reading_writing') + %span.toggle-switch-label.off + = t('.reading') - = button_to "Révoquer le jeton", api_token_path(@api_token), method: :delete, class: "fr-btn fr-btn--secondary", data: { turbo_confirm: "Confirmez-vous la révocation de ce jeton ? Les applications qui l’utilisent actuellement seront bloquées." } + = button_to t('.revoke_token'), api_token_path(@api_token), method: :delete, class: "fr-btn fr-btn--secondary", data: { turbo_confirm: "Confirmez-vous la révocation de ce jeton ? Les applications qui l’utilisent actuellement seront bloquées." } From be16cb6f5ee1c489f4fae3edcaa4fd129cf66e74 Mon Sep 17 00:00:00 2001 From: Julie Salha Date: Tue, 18 Apr 2023 13:56:50 +0200 Subject: [PATCH 3/8] add missing translations footer email change password --- app/views/layouts/mailers/_signature.html.haml | 3 ++- config/locales/views/layouts/mailers/en.yml | 2 ++ config/locales/views/layouts/mailers/fr.yml | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/mailers/_signature.html.haml b/app/views/layouts/mailers/_signature.html.haml index c26f14396..69d2a64dd 100644 --- a/app/views/layouts/mailers/_signature.html.haml +++ b/app/views/layouts/mailers/_signature.html.haml @@ -5,4 +5,5 @@ = service.nom - else -# The WORD JOINER unicode entity (⁠) prevents email clients from auto-linking the signature - L’équipe #{APPLICATION_NAME.gsub(".","⁠.").html_safe} + = t('.team') + #{APPLICATION_NAME.gsub(".","⁠.").html_safe} diff --git a/config/locales/views/layouts/mailers/en.yml b/config/locales/views/layouts/mailers/en.yml index 4c54b1468..14844d400 100644 --- a/config/locales/views/layouts/mailers/en.yml +++ b/config/locales/views/layouts/mailers/en.yml @@ -11,3 +11,5 @@ en: by_email: "By email :" by_phone: "By phone :" schedule: "Schedule :" + signature: + team: "The team" diff --git a/config/locales/views/layouts/mailers/fr.yml b/config/locales/views/layouts/mailers/fr.yml index 92e067aac..1741da3a4 100644 --- a/config/locales/views/layouts/mailers/fr.yml +++ b/config/locales/views/layouts/mailers/fr.yml @@ -1,3 +1,4 @@ + fr: layouts: mailers: @@ -11,3 +12,5 @@ fr: by_email: "Par email :" by_phone: "Par téléphone :" schedule: "Horaires :" + signature: + team: "L’équipe" From b1dfc83c1730b94d51c13c7b81009379ed23e0ba Mon Sep 17 00:00:00 2001 From: Julie Salha Date: Tue, 18 Apr 2023 14:04:32 +0200 Subject: [PATCH 4/8] add translations upload group notice --- app/views/support/index.html.haml | 3 ++- config/locales/views/support/en.yml | 1 + config/locales/views/support/fr.yml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/support/index.html.haml b/app/views/support/index.html.haml index 261304735..e8101b974 100644 --- a/app/views/support/index.html.haml +++ b/app/views/support/index.html.haml @@ -61,7 +61,8 @@ .fr-upload-group = label_tag :piece_jointe, class: 'fr-label' do = t('pj', scope: [:utils]) - %span.fr-hint-text Taille maximale : 200 Mo. Formats supportés : jpg, png, pdf. + %span.fr-hint-text + = t('.notice_upload_group') %p.notice.hidden{ data: { 'contact-type-only': Helpscout::FormAdapter::TYPE_AMELIORATION } } = t('.notice_pj_product') diff --git a/config/locales/views/support/en.yml b/config/locales/views/support/en.yml index 1b16ef2ed..0fda6c690 100644 --- a/config/locales/views/support/en.yml +++ b/config/locales/views/support/en.yml @@ -8,6 +8,7 @@ en: our_answer: 👉 Our answer notice_pj_product: A screenshot can help us identify the element to improve. notice_pj_other: A screenshot can help us identify the issue. + notice_upload_group: "Maximum size: 200 MB. Supported formats: jpg, png, pdf." procedure_info: question: I've encountered a problem while completing my application answer_html: "

Are you sure that all the mandatory fields ( * ) are properly filled? diff --git a/config/locales/views/support/fr.yml b/config/locales/views/support/fr.yml index aebe2ca2e..45ec8aaaa 100644 --- a/config/locales/views/support/fr.yml +++ b/config/locales/views/support/fr.yml @@ -8,6 +8,7 @@ fr: our_answer: 👉 Notre réponse notice_pj_product: Une capture d’écran peut nous aider à identifier plus facilement l’endroit à améliorer. notice_pj_other: Une capture d’écran peut nous aider à identifier plus facilement le problème. + notice_upload_group: "Taille maximale : 200 Mo. Formats supportés : jpg, png, pdf." procedure_info: question: J’ai un problème lors du remplissage de mon dossier answer_html: "

Avez-vous bien vérifié que tous les champs obligatoires ( * ) sont remplis ? From f039b6687a9724527a5b7c654376b538a19d9cd6 Mon Sep 17 00:00:00 2001 From: Julie Salha Date: Tue, 18 Apr 2023 14:11:58 +0200 Subject: [PATCH 5/8] add translations account confirmation page --- .../dossiers/_deleted_dossiers_list.html.haml | 75 ++++++++++++------- .../dossiers/_hidden_dossiers_list.html.haml | 10 ++- config/locales/en.yml | 4 + config/locales/fr.yml | 4 + 4 files changed, 62 insertions(+), 31 deletions(-) diff --git a/app/views/users/dossiers/_deleted_dossiers_list.html.haml b/app/views/users/dossiers/_deleted_dossiers_list.html.haml index 55785b475..92088134f 100644 --- a/app/views/users/dossiers/_deleted_dossiers_list.html.haml +++ b/app/views/users/dossiers/_deleted_dossiers_list.html.haml @@ -1,33 +1,54 @@ -- if deleted_dossiers.present? - %table.table.dossiers-table.hoverable - %thead - %tr - %th.number-col Nº dossier - %th Démarche - %th Raison de suppression - %th Date de suppression - %tbody - - deleted_dossiers.each do |dossier| - - libelle_demarche = Procedure.find(dossier.procedure_id).libelle +- if dossiers.present? + .fr-table.fr-table--bordered + %table.table.dossiers-table.hoverable + %caption= t('views.users.dossiers.dossiers_list.caption') + %thead + %tr + %th.number-col{ scope: :col }= t('views.users.dossiers.dossiers_list.n_dossier') + %th{ scope: :col }= t('views.users.dossiers.dossiers_list.procedure') + - if dossiers.present? + %th{ scope: :col }= t('views.users.dossiers.dossiers_list.requester') + %th.status-col{ scope: :col }= t('views.users.dossiers.dossiers_list.status') + %th.updated-at-col{ scope: :col }= t('views.users.dossiers.dossiers_list.updated') + %th.action-col.follow-col{ scope: :col }= t('views.users.dossiers.dossiers_list.actions') + %tbody + - dossiers.each do |dossier| + - if dossier.transfer.present? + %tr.fr-background-alt--blue-france.no-border + %td.fr-py-2w{ colspan: 100 } + .flex.align-center + %p.fr-mb-0 + %small + = t('views.users.dossiers.transfers.sender_demande_en_cours', id: dossier.id, email: dossier.transfer.email) + .ml-auto + = link_to t('views.users.dossiers.transfers.revoke'), transfer_path(dossier.transfer), class: 'fr-btn fr-btn--sm fr-btn--tertiary-no-outline', method: :delete - %tr{ data: { 'dossier-id': dossier.dossier_id } } - %td.number-col - %span.icon.folder - = dossier.dossier_id - %td - = libelle_demarche + %tr{ data: { 'dossier-id': dossier.id } } + %th.number-col{ scope: :row } + = link_to(url_for_dossier(dossier), class: 'cell-link', tabindex: -1) do + %span.icon.folder + = dossier.id + %td + = link_to(url_for_dossier(dossier), class: 'cell-link') do + = procedure_libelle(dossier.procedure) + - if dossiers.present? + %td + %span.cell-link= demandeur_dossier(dossier) + %td.status-col + = status_badge(dossier.state) + %td.updated-at-col.cell-link + = try_format_date(dossier.updated_at) + %td.action-col.follow-col + = render partial: 'dossier_actions', locals: { dossier: dossier } - %td.cell-link - = deletion_reason_badge(dossier.reason) - %td - = dossier.updated_at.strftime('%d/%m/%Y') - - = paginate(deleted_dossiers) + = paginate(dossiers) - else .blank-tab - %h2.empty-text Aucun dossier. + %h2.empty-text + = t("views.users.dossiers.account_creation.empty") %p.empty-text-details - Pour remplir une démarche, contactez votre administration en lui demandant le lien de la démarche. - %br - Celui ci doit ressembler à #{APPLICATION_BASE_URL}/commencer/xxx. + = t("views.users.dossiers.account_creation.detail_one") + %p.empty-text-details + = t("views.users.dossiers.account_creation.detail_two") + #{APPLICATION_BASE_URL}/commencer/xxx. diff --git a/app/views/users/dossiers/_hidden_dossiers_list.html.haml b/app/views/users/dossiers/_hidden_dossiers_list.html.haml index 58f2f7eb1..e0af64935 100644 --- a/app/views/users/dossiers/_hidden_dossiers_list.html.haml +++ b/app/views/users/dossiers/_hidden_dossiers_list.html.haml @@ -29,8 +29,10 @@ - else .blank-tab - %h2.empty-text Aucun dossier. + %h2.empty-text + = t("views.users.dossiers.account_creation.empty") %p.empty-text-details - Pour remplir une démarche, contactez votre administration en lui demandant le lien de la démarche. - %br - Celui ci doit ressembler à #{APPLICATION_BASE_URL}/commencer/xxx. + = t("views.users.dossiers.account_creation.detail_one") + %p.empty-text-details + = t("views.users.dossiers.account_creation.detail_two") + #{APPLICATION_BASE_URL}/commencer/xxx. diff --git a/config/locales/en.yml b/config/locales/en.yml index f5d189fb9..bf3ca9009 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -386,6 +386,10 @@ en: dossier_not_in_instructor_group: "File no. %{dossier_id} of the “%{procedure_libelle}” procedure corresponds to your search, but it is attached to the “%{groupe_instructeur_label}” instructor group." users: dossiers: + account_creation: + empty: "No file" + empty_details_one: "To complete a procedure, contact your administration and ask for the link to the procedure." + empty_details_two: "This one should look like" archived_dossier: "Your file will be kept %{duree_conservation_dossiers_dans_ds} more months" identite: identity_data: Identity data diff --git a/config/locales/fr.yml b/config/locales/fr.yml index cd52c4f3a..b7b40a787 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -387,6 +387,10 @@ fr: dossier_not_in_instructor_group: "Le dossier n° %{dossier_id} de la procédure « %{procedure_libelle} » correspond à votre recherche mais il est rattaché au groupe d’instructeurs « %{groupe_instructeur_label} »." users: dossiers: + account_creation: + empty: "Aucun dossier" + detail_one: "Pour remplir une démarche, contactez votre administration en lui demandant le lien de la démarche." + detail_two: "Celui ci doit ressembler à" archived_dossier: "Votre dossier sera conservé %{duree_conservation_dossiers_dans_ds} mois supplémentaire" identite: identity_data: Données d’identité From f4ffbbf0429b04b37ce04043bfec59ac8b24cb2f Mon Sep 17 00:00:00 2001 From: Julie Salha Date: Tue, 18 Apr 2023 14:21:09 +0200 Subject: [PATCH 6/8] add missing translations --- config/locales/en.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index bf3ca9009..3eeeaa354 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -388,8 +388,8 @@ en: dossiers: account_creation: empty: "No file" - empty_details_one: "To complete a procedure, contact your administration and ask for the link to the procedure." - empty_details_two: "This one should look like" + detail_one: "To complete a procedure, contact your administration and ask for the link to the procedure." + detail_two: "This one should look like" archived_dossier: "Your file will be kept %{duree_conservation_dossiers_dans_ds} more months" identite: identity_data: Identity data From f80cccba9376584a7f7f747fba4702f198a2490e Mon Sep 17 00:00:00 2001 From: Julie Salha Date: Tue, 18 Apr 2023 14:54:01 +0200 Subject: [PATCH 7/8] reset component yes no structure --- .../yes_no_component/yes_no_component.html.haml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/components/editable_champ/yes_no_component/yes_no_component.html.haml b/app/components/editable_champ/yes_no_component/yes_no_component.html.haml index 013659574..7dfb2d9e3 100644 --- a/app/components/editable_champ/yes_no_component/yes_no_component.html.haml +++ b/app/components/editable_champ/yes_no_component/yes_no_component.html.haml @@ -2,14 +2,10 @@ %legend.fr-fieldset__legend.visually-hidden = t(".legend") - .fr-fieldset__element.fr-fieldset__element--inline - .fr-radio-group - = @form.radio_button :value, false, id: @champ.yes_input_id - %label.fr-label{ for: @champ.yes_input_id } - = t(".yes") + %label{ for: @champ.yes_input_id } + = @form.radio_button :value, true, id: @champ.yes_input_id + = t(".yes") - .fr-fieldset__element.fr-fieldset__element--inline - .fr-radio-group - = @form.radio_button :value, false, id: @champ.no_input_id - %label.fr-label{ for: @champ.no_input_id } - = t(".no") + %label{ for: @champ.no_input_id } + = @form.radio_button :value, false, id: @champ.no_input_id + = t(".no") From e5df31fd665157e64c395a9126f5bf9b58b18a18 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 19 Apr 2023 18:26:40 +0200 Subject: [PATCH 8/8] fix(yaml): yes & no are reserved keywords in yaml, so they have to be quoted --- .../editable_champ/yes_no_component/yes_no_component.en.yml | 4 ++-- .../editable_champ/yes_no_component/yes_no_component.fr.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/editable_champ/yes_no_component/yes_no_component.en.yml b/app/components/editable_champ/yes_no_component/yes_no_component.en.yml index 55271e5e3..52b0723a2 100644 --- a/app/components/editable_champ/yes_no_component/yes_no_component.en.yml +++ b/app/components/editable_champ/yes_no_component/yes_no_component.en.yml @@ -1,4 +1,4 @@ en: - yes: "Yes" - no: "No" + "yes": "Yes" + "no": "No" legend: "Yes/No" diff --git a/app/components/editable_champ/yes_no_component/yes_no_component.fr.yml b/app/components/editable_champ/yes_no_component/yes_no_component.fr.yml index cb1ee0cfd..448d81681 100644 --- a/app/components/editable_champ/yes_no_component/yes_no_component.fr.yml +++ b/app/components/editable_champ/yes_no_component/yes_no_component.fr.yml @@ -1,4 +1,4 @@ fr: - yes: "Oui" - no: "Non" + "yes": "Oui" + "no": "Non" legend: "Oui/Non"