From 58d2ad66cabcb3a36a85b5f9d122bef0d8b1287d Mon Sep 17 00:00:00 2001 From: Duncan de Wet Date: Fri, 26 Sep 2014 19:32:30 +1200 Subject: [PATCH] Add autofocus attribute to all the first form fields --- app/views/devise/confirmations/new.html.erb | 2 +- app/views/devise/passwords/edit.html.erb | 2 +- app/views/devise/passwords/new.html.erb | 2 +- app/views/devise/registrations/edit.html.erb | 2 +- app/views/devise/registrations/new.html.erb | 2 +- app/views/devise/unlocks/new.html.erb | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index ff2885c..1d87130 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -7,7 +7,7 @@ <%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, role: "form" }) do |f| %>
<%= f.label :email %> - <%= f.email_field :email, class: "form-control" %> + <%= f.email_field :email, autofocus: true, class: "form-control" %>
<%= f.submit t('.resend_confirmation_instructions', :default => 'Resend confirmation instructions'), class: "btn btn-primary" %> diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb index f17afc8..30b0479 100644 --- a/app/views/devise/passwords/edit.html.erb +++ b/app/views/devise/passwords/edit.html.erb @@ -9,7 +9,7 @@
<%= f.label :password, t('.new_password', :default => 'New password') %> - <%= f.password_field :password, class: "form-control" %> + <%= f.password_field :password, autofocus: true, class: "form-control" %>
diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 391043f..91731da 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -7,7 +7,7 @@ <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, role: "form" }) do |f| %>
<%= f.label :email %> - <%= f.email_field :email, class: "form-control" %> + <%= f.email_field :email, autofocus: true, class: "form-control" %>
<%= f.submit t('.send_me_reset_password_instructions', :default => "Send me reset password instructions"), class: "btn btn-primary" %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 63b94b0..48ca425 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -7,7 +7,7 @@ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
<%= f.label :email %> - <%= f.email_field :email, class: "form-control" %> + <%= f.email_field :email, autofocus: true, class: "form-control" %>
<%= f.label :password %> (<%= t('.leave_blank_if_you_don_t_want_to_change_it', :default => "leave blank if you don't want to change it") %>)
diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 1829de5..6d586f0 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -7,7 +7,7 @@ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { role: "form" }) do |f| %>
<%= f.label :email %> - <%= f.email_field :email, class: "form-control" %> + <%= f.email_field :email, autofocus: true, class: "form-control" %>
<%= f.label :password %>
diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index 20e52bc..aa45c91 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -7,7 +7,7 @@ <%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post, html: { role: "form" } }) do |f| %>
<%= f.label :email %> - <%= f.email_field :email, class: "form-control" %> + <%= f.email_field :email, autofocus: true, class: "form-control" %>
<%= f.submit t('.resend_unlock_instructions', :default => "Resend unlock instructions"), class: "btn btn-primary"%> <% end %>