Skip to content
Extraits de code Groupes Projets
Valider 3a616469 rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

Merge pull request #4707 from goobertron/improved_new_password

New reset password form

Conflicts:
	Changelog.md
parents b59bb75b 2a145e67
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -9,6 +9,7 @@
* Improve stream generation time [#4769](https://github.com/diaspora/diaspora/pull/4769)
* Port help pages to backbone [#4768](https://github.com/diaspora/diaspora/pull/4768)
* Add participants to conversations menu [#4656](https://github.com/diaspora/diaspora/pull/4656)
* Update forgot_password and reset_password pages [#4707](https://github.com/diaspora/diaspora/pull/4707)
## Bug fixes
* Improve time agos by updating the plugin [#4280](https://github.com/diaspora/diaspora/issues/4280)
......
......@@ -32,7 +32,9 @@ a { color : $link-blue }
}
}
#login {
#login,
#forgot_password,
#reset_password {
background-image : image_url("texture/light-bg.png");
height: 100%;
}
......
#login {
#login,
#forgot_password,
#reset_password {
position : absolute;
top : 0;
left : 0;
......@@ -8,6 +10,10 @@
//color : #fff;
text-align : center;
label {
text-transform: uppercase;
}
input[type=text],
input[type=password] {
width : 120px;
......
class PasswordsController < Devise::PasswordsController
layout "application", :only => [:new]
before_filter -> { @css_framework = :bootstrap }, only: [:new, :create, :edit]
end
.span-12.prepend-6.last
.floating
%h2
= t('.change_password')
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f|
= devise_error_messages!
= f.hidden_field :reset_password_token
%p
= f.label :password, t('password')
%br/
= f.password_field :password
%p
= f.label :password_confirmation, t('password_confirmation')
%br/
= f.password_field :password_confirmation
%p
= f.submit t('.change_password')
= render :partial => "devise/shared/links"
.span-12.prepend-6.last
.floating
%h2
= t('.forgot_password')
- unless devise_error_messages!.empty?
%i= t('.no_account')
= form_for(resource, :as => resource_name, :url => password_path(resource_name)) do |f|
%p
= f.label :email, t('email')
= f.text_field :email
%p
= f.submit t('.send_password_instructions')
= render :partial => "devise/shared/links"
- content_for :page_title do
= "#{AppConfig.settings.pod_name} / #{t('devise.passwords.edit.change_password')}"
#reset_password
%h1{id: "huge-text"}= AppConfig.settings.pod_name
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => {:class => "form-horizontal block-form", :method => :put }, :autocomplete => 'off') do |f|
%fieldset
= f.hidden_field :reset_password_token
.control-group
%label{class: "control-label", for: "user_password", style: "width: 45%; text-align: right; padding: 10px 0; overflow: hidden"}
= t('devise.passwords.edit.new_password')
.controls
= f.password_field :password, :required => true, :placeholder => "••••••••", :autocapitalize => "off", :autocorrect => "off", :autofocus => true, :style => "width: 55%;"
.control-group
%label{class: "control-label", for: "user_password_confirmation", style: "width: 45%; text-align: right; padding: 10px 0; overflow: hidden"}
= t('devise.passwords.edit.confirm_password')
.controls
= f.password_field :password_confirmation, :required => true, :placeholder => "••••••••", :autocapitalize => "off", :autocorrect => "off", :style => "width: 55%;"
= hidden_field(:user, :remember_me, :value => 1)
= f.submit t('devise.passwords.edit.change_password'), :class => "new-btn"
%br/
%br/
%br/
= link_to t('devise.shared.links.sign_in'), new_session_path(resource_name)
- content_for :page_title do
= "#{AppConfig.settings.pod_name} / #{t('devise.passwords.new.forgot_password')}"
#forgot_password
%h1{id: "huge-text"}= AppConfig.settings.pod_name
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => {:class => "form-horizontal block-form"}, :autocomplete => 'off') do |f|
%fieldset
.control-group
%label{class: "control-label", for: "user_email", style: "width: 40%; text-align: center; padding: 10px 0; overflow: hidden"}
= t('devise.passwords.new.email')
.controls
= f.text_field :email, :required => true, :autocapitalize => "off", :placeholder => "••••••••", :autocorrect => "off", :autofocus => true, :style => "width: 60%;"
= f.submit t('devise.passwords.new.send_password_instructions'), :class => "new-btn"
%br/
%br/
%br/
= link_to t('devise.shared.links.sign_in'), new_session_path(resource_name)
......@@ -30,9 +30,13 @@ en:
updated: 'Your password was changed successfully. You are now signed in.'
edit:
change_password: "Change my password"
new_password: "New password"
confirm_password: "Confirm password"
new:
forgot_password: "Forgot your password?"
no_account: 'No account with this email exists'
reset_password: "Reset password"
email: "Email address"
send_password_instructions: "Send me reset password instructions"
confirmations:
send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
......
......@@ -108,7 +108,7 @@ Diaspora::Application.routes.draw do
match 'users/edit' => redirect('/user/edit')
devise_for :users, :controllers => {:registrations => "registrations",
:password => "devise/passwords",
:passwords => "passwords",
:sessions => "sessions"}
#legacy routes to support old invite routes
......
......@@ -14,11 +14,11 @@ Feature: Change password
Scenario: Reset my password
Given a user with email "forgetful@users.net"
Given I am on forgot password page
When I fill out forgot password form with "Forgetful@users.net"
When I fill out forgot password form with "forgetful@users.net"
And I submit forgot password form
Then I should see "You will receive an email with instructions"
When I follow the "Change my password" link from the last sent email
Then I should see "Change my password"
Then I should see "NEW PASSWORD"
When I fill out reset password form with "supersecret" and "supersecret"
And I submit reset password form
Then I should be on the stream page
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter