From e26cee8d9d2d17299ddbca1d3b90ed5c3f7d8508 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Tue, 5 Jul 2022 13:47:40 +0200 Subject: [PATCH] style(champ): add default placeholders for text & textarea champs cc #7429 --- app/views/shared/dossiers/editable_champs/_text.html.haml | 2 +- app/views/shared/dossiers/editable_champs/_textarea.html.haml | 3 ++- config/locales/shared.en.yml | 4 ++++ config/locales/shared.fr.yml | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/shared/dossiers/editable_champs/_text.html.haml b/app/views/shared/dossiers/editable_champs/_text.html.haml index ff4aee988..0408b7bad 100644 --- a/app/views/shared/dossiers/editable_champs/_text.html.haml +++ b/app/views/shared/dossiers/editable_champs/_text.html.haml @@ -1,5 +1,5 @@ = form.text_field :value, id: champ.input_id, - placeholder: champ.libelle, + placeholder: t(".placeholder"), required: champ.mandatory?, aria: { describedby: champ.describedby_id } diff --git a/app/views/shared/dossiers/editable_champs/_textarea.html.haml b/app/views/shared/dossiers/editable_champs/_textarea.html.haml index e1fc24cda..2d666a10a 100644 --- a/app/views/shared/dossiers/editable_champs/_textarea.html.haml +++ b/app/views/shared/dossiers/editable_champs/_textarea.html.haml @@ -3,4 +3,5 @@ aria: { describedby: champ.describedby_id }, rows: 6, required: champ.mandatory?, - value: html_to_string(champ.value) + value: html_to_string(champ.value), + placeholder: t(".placeholder") diff --git a/config/locales/shared.en.yml b/config/locales/shared.en.yml index 9672ea0bc..0f6d0e4eb 100644 --- a/config/locales/shared.en.yml +++ b/config/locales/shared.en.yml @@ -27,6 +27,10 @@ en: siret: placeholder: "50000123456789" title: "The SIRET number must have exactly 14 digits" + text: + placeholder: "Your answer" + textarea: + placeholder: "Write your answer here" header: expires_at: brouillon: "Expires on %{date} (%{duree_conservation_totale} months after this file was created)" diff --git a/config/locales/shared.fr.yml b/config/locales/shared.fr.yml index 129492358..516b61876 100644 --- a/config/locales/shared.fr.yml +++ b/config/locales/shared.fr.yml @@ -27,6 +27,10 @@ fr: siret: placeholder: "50000123456789" title: "Le numéro de SIRET doit comporter exactement 14 chiffres" + text: + placeholder: "Votre réponse" + textarea: + placeholder: "Rédigez ici votre réponse" header: expires_at: brouillon: "Expirera le %{date} (%{duree_conservation_totale} mois après la création du dossier)"