summaryrefslogtreecommitdiff
path: root/app/controllers/oauth
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-05-01 10:39:11 +0200
committerDouwe Maan <douwe@gitlab.com>2015-05-01 10:39:16 +0200
commit92fd3ccee05acdfd5e498734ed287458a8dd21a3 (patch)
treea794a8017636ce7f50a7f4ef4201395894a5451e /app/controllers/oauth
parentae09c2a6db0d15caedc080c319add147c79fd02a (diff)
downloadgitlab-ce-92fd3ccee05acdfd5e498734ed287458a8dd21a3.tar.gz
Add helpers for header title and sidebar, and move setting those from controllers to layouts.
Diffstat (limited to 'app/controllers/oauth')
-rw-r--r--app/controllers/oauth/applications_controller.rb11
-rw-r--r--app/controllers/oauth/authorizations_controller.rb9
-rw-r--r--app/controllers/oauth/authorized_applications_controller.rb12
3 files changed, 9 insertions, 23 deletions
diff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rb
index f30a85564d4..507b8290a2b 100644
--- a/app/controllers/oauth/applications_controller.rb
+++ b/app/controllers/oauth/applications_controller.rb
@@ -1,6 +1,9 @@
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
+ include PageLayoutHelper
+
before_action :authenticate_user!
- before_action :set_title
+
+ layout 'profile'
def index
head :forbidden and return
@@ -36,10 +39,4 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
rescue_from ActiveRecord::RecordNotFound do |exception|
render "errors/not_found", layout: "errors", status: 404
end
-
- def set_title
- @title = "Profile"
- @title_url = profile_path
- @sidebar = "profile"
- end
end
diff --git a/app/controllers/oauth/authorizations_controller.rb b/app/controllers/oauth/authorizations_controller.rb
index c62890ba85b..24025d8c723 100644
--- a/app/controllers/oauth/authorizations_controller.rb
+++ b/app/controllers/oauth/authorizations_controller.rb
@@ -1,6 +1,7 @@
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
before_action :authenticate_resource_owner!
- before_action :set_title
+
+ layout 'profile'
def new
if pre_auth.authorizable?
@@ -54,10 +55,4 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
def strategy
@strategy ||= server.authorization_request(pre_auth.response_type)
end
-
- def set_title
- @title = "Profile"
- @title_url = profile_path
- @sidebar = "profile"
- end
end
diff --git a/app/controllers/oauth/authorized_applications_controller.rb b/app/controllers/oauth/authorized_applications_controller.rb
index 63c634f376b..3ab6def511c 100644
--- a/app/controllers/oauth/authorized_applications_controller.rb
+++ b/app/controllers/oauth/authorized_applications_controller.rb
@@ -1,16 +1,10 @@
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
- before_action :set_title
+ include PageLayoutHelper
+
+ layout 'profile'
def destroy
Doorkeeper::AccessToken.revoke_all_for(params[:id], current_resource_owner)
redirect_to applications_profile_url, notice: I18n.t(:notice, scope: [:doorkeeper, :flash, :authorized_applications, :destroy])
end
-
- private
-
- def set_title
- @title = "Profile"
- @title_url = profile_path
- @sidebar = "profile"
- end
end