From 24d758ee649e1aa98f9f02d1fd4af662741cd8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 16 Jun 2021 15:18:44 +0200 Subject: [PATCH] Use a label in the email verification email field We were using a paragraph before the field, and then a field with no label and a redundant placeholder. This causes accessibility issues for screen reader users, who will not hear the label being announced when entering the field, and to users who click on the label expecting it to automatically focus on its related field (which is the standard browser behavior). --- app/views/management/email_verifications/new.html.erb | 4 +--- config/locales/en/management.yml | 1 - config/locales/es/management.yml | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/views/management/email_verifications/new.html.erb b/app/views/management/email_verifications/new.html.erb index 6dea2f0f7..5245528e1 100644 --- a/app/views/management/email_verifications/new.html.erb +++ b/app/views/management/email_verifications/new.html.erb @@ -6,14 +6,12 @@
  • <%= t("management.email_verifications.if_existing_account") %> -

    <%= t("management.email_verifications.introduce_email") %>

    - <%= form_for @email_verification, as: :email_verification, url: management_email_verifications_path do |f| %> <%= f.hidden_field :document_type %> <%= f.hidden_field :document_number %> - <%= f.text_field :email, label: false, placeholder: t("management.email_verifications.email_placeholder") %> + <%= f.text_field :email, label: t("management.email_verifications.introduce_email") %> <%= f.submit t("management.email_verifications.send_email"), class: "button hollow" %> <% end %> diff --git a/config/locales/en/management.yml b/config/locales/en/management.yml index 3cc3df8f5..a66790849 100644 --- a/config/locales/en/management.yml +++ b/config/locales/en/management.yml @@ -49,7 +49,6 @@ en: choose_options: "Please choose one of the following options:" document_found_in_census: This document was found in the census, but it has no user account associated to it. document_mismatch: "This email belongs to a user which already has an associated id: %{document_number}(%{document_type})" - email_placeholder: Write the email this person used to create his or her account email_sent_instructions: In order to completely verify this user, it is necessary that the user clicks on a link which we have sent to the email address above. This step is needed in order to confirm that the address belongs to him. if_existing_account: If the person has already a user account created in the website, if_no_existing_account: If this person has not created an account yet diff --git a/config/locales/es/management.yml b/config/locales/es/management.yml index cd25049e4..e0e018d90 100644 --- a/config/locales/es/management.yml +++ b/config/locales/es/management.yml @@ -49,7 +49,6 @@ es: choose_options: "Elige una de las opciones siguientes:" document_found_in_census: Este documento está en el registro del padrón municipal, pero todavía no tiene una cuenta de usuario asociada. document_mismatch: "Ese email corresponde a un usuario que ya tiene asociado el documento %{document_number}(%{document_type})" - email_placeholder: Introduce el email de registro email_sent_instructions: Para terminar de verificar esta cuenta es necesario que haga clic en el enlace que le hemos enviado a la dirección de correo que figura arriba. Este paso es necesario para confirmar que dicha cuenta de usuario es suya. if_existing_account: Si la persona ya ha creado una cuenta de usuario en la web if_no_existing_account: Si la persona todavía no ha creado una cuenta de usuario en la web