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

Merge pull request #3647 from marpo60/3636-adds-password-confirmation-field

adds password_confirmation field to registration page
parents d979ac44 0b21153d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# 0.0.2.0pre # 0.0.2.0pre
Add password_confirmation field to registration page
Fix error with open/close registrations. Fix error with open/close registrations.
Fix javascripts error in invitations facebox. Fix javascripts error in invitations facebox.
Fix css overflow problem in aspect dropdown on welcome page. Fix css overflow problem in aspect dropdown on welcome page.
......
...@@ -39,4 +39,16 @@ ...@@ -39,4 +39,16 @@
max-width : 95%; max-width : 95%;
} }
}
\ No newline at end of file form {
.control-label,
.controls {
margin-left : auto;
width : auto;
}
.controls {
float : right;
}
}
}
...@@ -18,10 +18,10 @@ class RegistrationsController < Devise::RegistrationsController ...@@ -18,10 +18,10 @@ class RegistrationsController < Devise::RegistrationsController
Rails.logger.info("event=registration status=successful user=#{@user.diaspora_handle}") Rails.logger.info("event=registration status=successful user=#{@user.diaspora_handle}")
else else
@user.errors.delete(:person) @user.errors.delete(:person)
flash[:error] = @user.errors.full_messages.join(" - ") flash[:error] = @user.errors.full_messages.join(" - ")
Rails.logger.info("event=registration status=failure errors='#{@user.errors.full_messages.join(', ')}'") Rails.logger.info("event=registration status=failure errors='#{@user.errors.full_messages.join(', ')}'")
render :new redirect_to :back
end end
end end
...@@ -50,6 +50,6 @@ class RegistrationsController < Devise::RegistrationsController ...@@ -50,6 +50,6 @@ class RegistrationsController < Devise::RegistrationsController
@invite ||= InvitationCode.find_by_token(params[:invite][:token]) @invite ||= InvitationCode.find_by_token(params[:invite][:token])
end end
end end
helper_method :invite helper_method :invite
end end
...@@ -50,6 +50,16 @@ ...@@ -50,6 +50,16 @@
<%= f.password_field :password, :placeholder => "••••••••", :title => t('registrations.new.enter_password'), :required => true, :pattern => "......+" %> <%= f.password_field :password, :placeholder => "••••••••", :title => t('registrations.new.enter_password'), :required => true, :pattern => "......+" %>
</div> </div>
</div> </div>
<div class="control-group">
<label class="control-label" for="user_password_confirmation">
<%= t('.password_confirmation') %>
</label>
<div class="controls">
<%= f.password_field :password_confirmation, :placeholder => "••••••••", :title => t('registrations.new.enter_password_again'), :required => true, :pattern => "......+" %>
</div>
</div>
<%= invite_hidden_tag(invite) %> <%= invite_hidden_tag(invite) %>
</fieldset> </fieldset>
......
...@@ -687,6 +687,7 @@ en: ...@@ -687,6 +687,7 @@ en:
email: "EMAIL" email: "EMAIL"
username: "USERNAME" username: "USERNAME"
password: "PASSWORD" password: "PASSWORD"
password_confirmation: "PASSWORD CONFIRMATION"
continue: "Continue" continue: "Continue"
create: create:
success: "You've joined Diaspora!" success: "You've joined Diaspora!"
......
...@@ -7,6 +7,7 @@ Feature: invitation acceptance ...@@ -7,6 +7,7 @@ Feature: invitation acceptance
| user_username | ohai | | user_username | ohai |
| user_email | woot@sweet.com | | user_email | woot@sweet.com |
| user_password | secret | | user_password | secret |
| user_password_confirmation | secret |
And I press "Continue" And I press "Continue"
Then I should be on the getting started page Then I should be on the getting started page
And I should see "Well, hello there!" And I should see "Well, hello there!"
...@@ -24,6 +25,7 @@ Feature: invitation acceptance ...@@ -24,6 +25,7 @@ Feature: invitation acceptance
| user_username | ohai | | user_username | ohai |
| user_email | woot@sweet.com | | user_email | woot@sweet.com |
| user_password | secret | | user_password | secret |
| user_password_confirmation | secret |
And I press "Continue" And I press "Continue"
Then I should be on the getting started page Then I should be on the getting started page
And I should see "Well, hello there!" And I should see "Well, hello there!"
......
...@@ -4,9 +4,10 @@ Feature: new user registration ...@@ -4,9 +4,10 @@ Feature: new user registration
Background: Background:
When I go to the new user registration page When I go to the new user registration page
And I fill in the following: And I fill in the following:
| user_username | ohai | | user_username | ohai |
| user_email | ohai@example.com | | user_email | ohai@example.com |
| user_password | secret | | user_password | secret |
| user_password_confirmation | secret |
And I press "Continue" And I press "Continue"
Then I should be on the getting started page Then I should be on the getting started page
And I should see "Well, hello there!" and "Who are you?" and "What are you into?" And I should see "Well, hello there!" and "Who are you?" and "What are you into?"
......
...@@ -209,6 +209,7 @@ When /^I fill in the new user form$/ do ...@@ -209,6 +209,7 @@ When /^I fill in the new user form$/ do
step 'I fill in "user_username" with "ohai"' step 'I fill in "user_username" with "ohai"'
step 'I fill in "user_email" with "ohai@example.com"' step 'I fill in "user_email" with "ohai@example.com"'
step 'I fill in "user_password" with "secret"' step 'I fill in "user_password" with "secret"'
step 'I fill in "user_password_confirmation" with "secret"'
end end
And /^I should be able to friend Alice$/ do And /^I should be able to friend Alice$/ do
......
...@@ -112,9 +112,9 @@ describe RegistrationsController do ...@@ -112,9 +112,9 @@ describe RegistrationsController do
flash[:error].should_not be_blank flash[:error].should_not be_blank
end end
it "re-renders the form" do it "redirects back" do
get :create, @invalid_params get :create, @invalid_params
response.should render_template("registrations/new") response.should be_redirect
end end
end end
end end
......
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