Skip to content

Commit

Permalink
Update simple form templates
Browse files Browse the repository at this point in the history
Update `simple_form` templates with changes from 16b3d6d and 6260c29
  • Loading branch information
Gustavo Bazan authored and tegon committed May 8, 2018
1 parent be15116 commit cd9ad84
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* enhancements
* Add `autocomplete="new-password"` to new password fields (by @gssbzn)
* Add `autocomplete="current-password"` to current password fields (by @gssbzn)
* Update `simple_form` templates with changes from 16b3d6d67c7e017d461ea17ed29ea9738dc77e83 and 6260c29a867b9a656f1e1557abe347a523178fab (by @gssbzn)

### 4.4.3 - 2018-03-17

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<%= f.full_error :confirmation_token %>

<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<%= f.input :email,
required: true,
autofocus: true,
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email),
input_html: { autocomplete: "email" } %>
</div>

<div class="form-actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
<%= f.full_error :reset_password_token %>

<div class="form-inputs">
<%= f.input :password, label: "New password", required: true, autofocus: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length) %>
<%= f.input :password,
label: "New password",
required: true,
autofocus: true,
hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length),
input_html: { autocomplete: "new-password" } %>
<%= f.input :password_confirmation, label: "Confirm your new password", required: true %>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<%= f.error_notification %>

<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<%= f.input :email,
required: true,
autofocus: true,
input_html: { autocomplete: "email" } %>
</div>

<div class="form-actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
<% end %>

<%= f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false %>
<%= f.input :password_confirmation, required: false %>
<%= f.input :current_password, hint: "we need your current password to confirm your changes", required: true %>
<%= f.input :password,
hint: "leave it blank if you don't want to change it",
required: false
input_html: { autocomplete: "new-password" } %>
<%= f.input :password_confirmation,
required: false,
input_html: { autocomplete: "new-password" } %>
<%= f.input :current_password,
hint: "we need your current password to confirm your changes",
required: true,
input_html: { autocomplete: "current-password" } %>
</div>

<div class="form-actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@
<%= f.error_notification %>

<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<%= f.input :password, required: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length) %>
<%= f.input :password_confirmation, required: true %>
<%= f.input :email,
required: true,
autofocus: true ,
input_html: { autocomplete: "email" }%>
<%= f.input :password,
required: true,
hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length),
input_html: { autocomplete: "new-password" } %>
<%= f.input :password_confirmation,
required: true,
input_html: { autocomplete: "new-password" } %>
</div>

<div class="form-actions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email, required: false, autofocus: true %>
<%= f.input :password, required: false %>
<%= f.input :email,
required: false,
autofocus: true,
input_html: { autocomplete: "email" } %>
<%= f.input :password,
required: false,
input_html: { autocomplete: "current-password" } %>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<%= f.full_error :unlock_token %>

<div class="form-inputs">
<%= f.input :email, required: true, autofocus: true %>
<%= f.input :email,
required: true,
autofocus: true,
input_html: { autocomplete: "email" } %>
</div>

<div class="form-actions">
Expand Down

0 comments on commit cd9ad84

Please sign in to comment.