diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-05-01 10:39:11 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-05-01 10:39:16 +0200 |
commit | 92fd3ccee05acdfd5e498734ed287458a8dd21a3 (patch) | |
tree | a794a8017636ce7f50a7f4ef4201395894a5451e /app/controllers/profiles | |
parent | ae09c2a6db0d15caedc080c319add147c79fd02a (diff) | |
download | gitlab-ce-92fd3ccee05acdfd5e498734ed287458a8dd21a3.tar.gz |
Add helpers for header title and sidebar, and move setting those from controllers to layouts.
Diffstat (limited to 'app/controllers/profiles')
-rw-r--r-- | app/controllers/profiles/application_controller.rb | 10 | ||||
-rw-r--r-- | app/controllers/profiles/passwords_controller.rb | 9 |
2 files changed, 6 insertions, 13 deletions
diff --git a/app/controllers/profiles/application_controller.rb b/app/controllers/profiles/application_controller.rb index 8373ff7a758..c8be288b9a0 100644 --- a/app/controllers/profiles/application_controller.rb +++ b/app/controllers/profiles/application_controller.rb @@ -1,11 +1,3 @@ class Profiles::ApplicationController < ApplicationController - before_action :set_title - - private - - def set_title - @title = "Profile" - @title_url = profile_path - @sidebar = "profile" - end + layout 'profile' end diff --git a/app/controllers/profiles/passwords_controller.rb b/app/controllers/profiles/passwords_controller.rb index 86976ae39e3..c780e0983f9 100644 --- a/app/controllers/profiles/passwords_controller.rb +++ b/app/controllers/profiles/passwords_controller.rb @@ -2,9 +2,10 @@ class Profiles::PasswordsController < Profiles::ApplicationController skip_before_action :check_password_expiration, only: [:new, :create] before_action :set_user - before_action :set_title before_action :authorize_change_password! + layout :determine_layout + def new end @@ -64,11 +65,11 @@ class Profiles::PasswordsController < Profiles::ApplicationController @user = current_user end - def set_title + def determine_layout if [:new, :create].include?(action_name.to_sym) - @title = "New password" + 'application' else - super + 'profile' end end |