summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-02-19 14:18:25 -0800
committerjessib <jessib@leap.se>2013-02-19 14:18:25 -0800
commit2e2326d380ef1160c7d3cbfc446f96ef6eab2721 (patch)
tree775846ab66356d2e0bef4ae589578e51ae72f8ba
parent1023cac35016bb1a89864d10ac89acabe86cf227 (diff)
Needs some cleanup, but this has one form where user can change username and password (they can leave either the same if they just want to change one, but we should make this clearer.)
-rw-r--r--users/app/assets/javascripts/users.js.coffee4
-rw-r--r--users/app/views/users/_login_and_password_fields.html.haml3
-rw-r--r--users/app/views/users/edit.html.haml3
-rw-r--r--users/config/locales/en.yml1
4 files changed, 7 insertions, 4 deletions
diff --git a/users/app/assets/javascripts/users.js.coffee b/users/app/assets/javascripts/users.js.coffee
index 86bacee..a62be6d 100644
--- a/users/app/assets/javascripts/users.js.coffee
+++ b/users/app/assets/javascripts/users.js.coffee
@@ -37,8 +37,8 @@ $(document).ready ->
$('#new_user').submit srp.signup
$('#new_session').submit preventDefault
$('#new_session').submit srp.login
- $('.user.form.change_password').submit srp.update
- $('.user.form.change_password').submit preventDefault
+ $('.user.form.change_login_and_password').submit srp.update
+ $('.user.form.change_login_and_password').submit preventDefault
$('.user.typeahead').typeahead({source: pollUsers});
$('a[data-toggle="tab"]').on('shown', ->
$(ClientSideValidations.selectors.forms).validate()
diff --git a/users/app/views/users/_login_and_password_fields.html.haml b/users/app/views/users/_login_and_password_fields.html.haml
new file mode 100644
index 0000000..4d4585a
--- /dev/null
+++ b/users/app/views/users/_login_and_password_fields.html.haml
@@ -0,0 +1,3 @@
+= f.input :login, :required => true, :input_html => { :id => :srp_username }
+= f.input :password, :required => true, :validate => true, :input_html => { :id => :srp_password }
+= f.input :password_confirmation, :required => true, :input_html => { :id => :srp_password_confirmation } \ No newline at end of file
diff --git a/users/app/views/users/edit.html.haml b/users/app/views/users/edit.html.haml
index 950a3b1..0dcd474 100644
--- a/users/app/views/users/edit.html.haml
+++ b/users/app/views/users/edit.html.haml
@@ -1,8 +1,7 @@
.span8.offset2
%h2=t :settings
- content_for :account do
- = user_form_with 'login_field', :legend => :change_login
- = user_form_with 'password_fields', :legend => :change_password
+ = user_form_with 'login_and_password_fields', :legend => :change_login_and_password
= render 'cancel_account' if @user == current_user
- content_for :email do
%legend=t :email_address
diff --git a/users/config/locales/en.yml b/users/config/locales/en.yml
index 493b5db..d5f5795 100644
--- a/users/config/locales/en.yml
+++ b/users/config/locales/en.yml
@@ -8,6 +8,7 @@ en:
wrong_password: "wrong password"
user_not_found: "could not be found"
change_login: "Change Login"
+ change_login_and_password: "Change Login and Password"
change_password: "Change Password"
cancel_account: "Cancel your account"
set_email_address: "Set email address"