diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml
index 63ba858..f63bb44 100644
--- a/app/views/devise/passwords/new.html.haml
+++ b/app/views/devise/passwords/new.html.haml
@@ -3,6 +3,7 @@
= errors_for resource
.required
= f.label :email
- = f.text_field :email
-
- %div.buttons= f.submit "Send me reset password instructions"
\ No newline at end of file
+ = f.text_field :email, :value => params[:email]
+
+ %div.buttons= f.submit "Send me reset password instructions"
+
diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml
index 8b3986b..1df70c9 100644
--- a/app/views/devise/sessions/new.html.haml
+++ b/app/views/devise/sessions/new.html.haml
@@ -1,13 +1,13 @@
- content_for :title, 'Sign in'
+- auth_key = Devise.authentication_keys.first
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
- - auth_key = Devise.authentication_keys.first
.required
= f.label auth_key
= f.text_field auth_key, :tabindex => 1
.required
- = link_to 'forget it?', new_password_path(resource_name), :class => 'float-right'
+ = link_to 'forget it?', new_password_path(resource_name), :class => 'float-right', :id => "forgot_password"
= f.label :password
= f.password_field :password, :tabindex => 2
@@ -19,3 +19,10 @@
%div.buttons
%button{:type => 'submit', :class => 'sign_in'}= "Sign in"
+:javascript
+ $('a#forgot_password').click(function(){
+ // Set email field on password reset page to email that user entered on this page
+ location.href = $(this).attr('href') + "?email=" + $('#user_#{auth_key}').val();
+ return false;
+ });
+
--
libgit2 0.21.2