From: Tom Hughes Date: Tue, 4 Aug 2009 00:14:03 +0000 (+0000) Subject: Tweak the password reset pages a bit. X-Git-Tag: live~6760 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/39cbc9d653d7ff685626ec7873d04fbd315b480b?hp=60303ee06b6dbb0ae66bd6e06b833f07d65d5ff9 Tweak the password reset pages a bit. --- diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 6d69b5120..f4ff7fb70 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -109,8 +109,9 @@ class UserController < ApplicationController token = UserToken.find_by_token(params[:token]) if token + @user = token.user + if params[:user] - @user = token.user @user.pass_crypt = params[:user][:pass_crypt] @user.pass_crypt_confirmation = params[:user][:pass_crypt_confirmation] @user.active = true diff --git a/app/views/user/reset_password.html.erb b/app/views/user/reset_password.html.erb index 458a6084c..7d2da5c78 100644 --- a/app/views/user/reset_password.html.erb +++ b/app/views/user/reset_password.html.erb @@ -1,12 +1,12 @@ -

<%= t 'user.reset_password.heading' %>

+

<%= t 'user.reset_password.heading', :user => @user.display_name %>

<%= error_messages_for :user %> <% form_tag do %> <%= hidden_field_tag(:token, params[:token]) %> - - + + diff --git a/config/locales/en.yml b/config/locales/en.yml index 9283fcb57..9964dbccf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -791,12 +791,12 @@ en: title: "Lost password" heading: "Forgotten Password?" email address: "Email Address:" - new password button: "Send me a new password" + new password button: "Reset password" notice email on way: "Sorry you lost it :-( but an email is on its way so you can reset it soon." notice email cannot find: "Couldn't find that email address, sorry." reset_password: title: "Reset password" - heading: "Reset Password" + heading: "Reset Password for {{user}}" password: "Password: " confirm password: "Confirm Password: " reset: "Reset Password"
<%= t 'user.reset_password.password' %><%= password_field(:user, :pass_crypt,{:size => 30, :maxlength => 255, :tabindex => 4}) %>
<%= t 'user.reset_password.confirm password' %><%= password_field(:user, :pass_crypt_confirmation,{:size => 30, :maxlength => 255, :tabindex => 5}) %>
<%= t 'user.reset_password.password' %><%= password_field(:user, :pass_crypt, {:value => '', :size => 30, :maxlength => 255, :tabindex => 4}) %>
<%= t 'user.reset_password.confirm password' %><%= password_field(:user, :pass_crypt_confirmation, {:value => '', :size => 30, :maxlength => 255, :tabindex => 5}) %>