-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve a11y on user signup form (#784)
Co-authored-by: Mathieu Ripert <[email protected]>
- Loading branch information
Showing
1 changed file
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<div class="bg-white p-3 py-4 p-lg-4 rounded"> | ||
<%= simple_form_for @user do |f| %> | ||
<div class="bg-white p-3 py-4 p-lg-4 rounded"> | ||
|
||
<% if @user.present? && @user.errors.any? %> | ||
<div class="alert alert-danger" role="alert" style="position: inherit"> | ||
<% @user.errors.full_messages.each do |msg| %> | ||
<%= msg %><br/> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
<% if @user.present? && @user.errors.any? %> | ||
<div class="alert alert-danger" role="alert" style="position: inherit"> | ||
<% @user.errors.full_messages.each do |msg| %> | ||
<%= msg %><br/> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
|
||
<%= simple_form_for @user do |f| %> | ||
<%= f.input :email, | ||
label: false, | ||
label: "Adresse email", | ||
error: f.error(:email), | ||
placeholder: "[email protected]", | ||
hint: "Une adresse email ne peut être utilisée que par une seule personne.", | ||
|
@@ -20,25 +20,25 @@ | |
<hr> | ||
|
||
<%= f.input :address, | ||
label: false, | ||
label: "Adresse", | ||
error: f.error(:address), | ||
placeholder: "Adresse", | ||
placeholder: "5 avenue de Paris", | ||
required: true, | ||
input_html: {class: "pr-5"} %> | ||
|
||
<%= f.input_field :lat, as: :hidden %> | ||
<%= f.input_field :lon, as: :hidden %> | ||
|
||
<%= f.input :phone_number, | ||
label: false, | ||
label: "Numéro de téléphone portable", | ||
error: "Numéro de téléphone invalide", | ||
placeholder: "Numéro de téléphone portable", | ||
placeholder: "06 00 00 00 00", | ||
required: true, | ||
input_html: {autocomplete: "tel"} %> | ||
|
||
<%= f.input :birthdate, | ||
as: :date, | ||
label: false, | ||
label: "Date de naissance", | ||
order: [:day, :month, :year], | ||
start_year: Date.today.year - 120, | ||
end_year: Date.today.year - 18, | ||
|
@@ -54,9 +54,9 @@ | |
|
||
<%= f.invisible_captcha :subtitle %> | ||
<%= f.button :submit, "S’inscrire", class: "btn btn-secondary btn-lg btn-block font-weight-bold", data: {disable_with: "Inscription en cours..."} %> | ||
<% end %> | ||
|
||
</div> | ||
<div class="py-1 px-2"> | ||
<%= render partial: "users/mentions" %> | ||
</div> | ||
</div> | ||
<div class="py-1 px-2"> | ||
<%= render partial: "users/mentions" %> | ||
</div> | ||
<% end %> |