demarches-normaliennes/app/views/users/registrations/new.html.haml
clemkeirua 1bdc0836a6 password length for screen reader on /users/sign_up
We use a placeholder (which is not made for this, but we have reasons to do that)
so using a visible labels or paragraph duplicates the information

I picked aria-describedby, which is not the ideal solution (it seems to be aria-labelledby) but which is the most widely supported

https://www.w3.org/WAI/tutorials/forms/instructions/#using-aria-describedby
2020-03-25 09:50:41 +00:00

27 lines
1.1 KiB
Text

= content_for(:page_id, 'auth')
.auth-form
= devise_error_messages!
= form_for resource, url: user_registration_path, html: { class: "form" } do |f|
%h1 Créez-vous un compte demarches-simplifiees.fr
= f.label :email, "Email"
= f.text_field :email, autofocus: true, placeholder: "Votre adresse email"
.suspect-email.hidden
.email-suggestion-title
Voulez-vous dire
%span.email-suggestion-address blabla@gmail.com
 ?
.email-suggestion-answer
= button_tag type: 'button', class: 'button small', onclick: "DS.acceptEmailSuggestion()" do
Oui
= button_tag type: 'button', class: 'button small', onclick: "DS.discardEmailSuggestionBox()" do
Non
= f.label :password, "Mot de passe"
= f.password_field :password, value: @user.password, placeholder: "8 caractères minimum", 'aria-describedby':'8 caractères minimum'
= f.submit "Créer un compte", class: "button large primary expand"
= render partial: 'shared/france_connect_login', locals: { url: france_connect_particulier_path }