summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
Diffstat (limited to 'users')
-rw-r--r--users/app/controllers/users_controller.rb10
-rw-r--r--users/app/helpers/users_helper.rb4
-rw-r--r--users/app/views/users/edit.html.haml24
3 files changed, 19 insertions, 19 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index 5c6767c..3d71c1a 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -3,6 +3,7 @@ class UsersController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => [:create]
before_filter :fetch_user, :only => [:edit, :update, :destroy]
+ before_filter :set_anchor, :only => [:edit, :update]
before_filter :authorize_admin, :only => [:index]
respond_to :json, :html
@@ -50,4 +51,13 @@ class UsersController < ApplicationController
@user = User.find_by_param(params[:id])
access_denied unless admin? or (@user == current_user)
end
+
+ def set_anchor
+ @anchor = email_settings? ? :email : :account
+ end
+
+ def email_settings?
+ params[:user] &&
+ params[:user].keys.detect{|key| key.index('email')}
+ end
end
diff --git a/users/app/helpers/users_helper.rb b/users/app/helpers/users_helper.rb
index 6d76d6f..45ca0e9 100644
--- a/users/app/helpers/users_helper.rb
+++ b/users/app/helpers/users_helper.rb
@@ -30,8 +30,4 @@ module UsersHelper
classes.compact
end
- def email_settings?
- params[:user] &&
- params[:user].keys.detect{|key| key.index('email')}
- end
end
diff --git a/users/app/views/users/edit.html.haml b/users/app/views/users/edit.html.haml
index 8fc2cab..820b80e 100644
--- a/users/app/views/users/edit.html.haml
+++ b/users/app/views/users/edit.html.haml
@@ -1,17 +1,11 @@
.span8.offset2
%h2=t :settings
- %ul.nav.nav-tabs
- %li{:class => email_settings? ? :inactive : :active}
- %a{:href => '#account', 'data-toggle' => 'tab'}Account
- %li{:class => email_settings? ? :active : :inactive}
- %a{:href => '#email', 'data-toggle' => 'tab'}Email
-
- .tab-content
- .tab-pane#account{:class => email_settings? ? :inactive : :active}
- = user_form_with 'login_field', :legend => :change_login
- = user_form_with 'password_fields', :legend => :change_password
- = render 'cancel_account' if @user == current_user
- .tab-pane#email{:class => email_settings? ? :active : :inactive}
- = user_form_with 'email_field', :legend => :set_email_address
- = user_form_with 'email_forward_field', :legend => :forward_email
- = user_form_with 'email_aliases', :legend => :add_email_alias
+ - content_for :account do
+ = user_form_with 'login_field', :legend => :change_login
+ = user_form_with 'password_fields', :legend => :change_password
+ = render 'cancel_account' if @user == current_user
+ - content_for :email do
+ = user_form_with 'email_field', :legend => :set_email_address
+ = user_form_with 'email_forward_field', :legend => :forward_email
+ = user_form_with 'email_aliases', :legend => :add_email_alias
+ = render 'tabs/tabs', :tabs => [:account, :email]