]> git.openstreetmap.org Git - rails.git/commitdiff
Tweak the password reset pages a bit.
authorTom Hughes <tom@compton.nu>
Tue, 4 Aug 2009 00:14:03 +0000 (00:14 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 4 Aug 2009 00:14:03 +0000 (00:14 +0000)
app/controllers/user_controller.rb
app/views/user/reset_password.html.erb
config/locales/en.yml

index 6d69b512011647f8bac599267299eb44e780d0ed..f4ff7fb7098bad18bf7dd28f293ffd4c7d6102ec 100644 (file)
@@ -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
index 458a6084cffc7118ab60f5b1e52bd7b04e89bed0..7d2da5c78e1bb67748aaf7a2ec4629bb962181ea 100644 (file)
@@ -1,12 +1,12 @@
-<h1><%= t 'user.reset_password.heading' %></h1>
+<h1><%= t 'user.reset_password.heading', :user => @user.display_name %></h1>
 
 <%= error_messages_for :user %>
 
 <% form_tag do %>
 <%= hidden_field_tag(:token, params[:token]) %>
 <table id="loginForm">
-  <tr><td class="fieldName"><%= t 'user.reset_password.password' %></td><td><%= password_field(:user, :pass_crypt,{:size => 30, :maxlength => 255, :tabindex => 4}) %></td></tr>
-  <tr><td class="fieldName"><%= t 'user.reset_password.confirm password' %></td><td><%= password_field(:user, :pass_crypt_confirmation,{:size => 30, :maxlength => 255, :tabindex => 5}) %></td></tr>
+  <tr><td class="fieldName"><%= t 'user.reset_password.password' %></td><td><%= password_field(:user, :pass_crypt, {:value => '', :size => 30, :maxlength => 255, :tabindex => 4}) %></td></tr>
+  <tr><td class="fieldName"><%= t 'user.reset_password.confirm password' %></td><td><%= password_field(:user, :pass_crypt_confirmation, {:value => '', :size => 30, :maxlength => 255, :tabindex => 5}) %></td></tr>
   
   <tr><td colspan=2>&nbsp;<!--vertical spacer--></td></tr>
   <tr><td></td><td align=right><input type="submit" value="<%= t'user.reset_password.reset' %>" tabindex="6"></td></tr>
index 9283fcb575d22f1eb614a2083be7727dc7b3b9fb..9964dbccfb8ab1938a4943e39649db08dea80606 100644 (file)
@@ -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"