Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
df9cb930
Commit
df9cb930
authored
Sep 19, 2018
by
Martin Wortschack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add empty controller actions and utilize referer_path helper
parent
0df11843
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
app/controllers/admin/application_settings_controller.rb
app/controllers/admin/application_settings_controller.rb
+24
-2
app/controllers/concerns/internal_redirect.rb
app/controllers/concerns/internal_redirect.rb
+6
-0
No files found.
app/controllers/admin/application_settings_controller.rb
View file @
df9cb930
class
Admin::ApplicationSettingsController
<
Admin
::
ApplicationController
include
InternalRedirect
before_action
:set_application_setting
def
show
end
def
geo
def
integrations
end
def
repository
end
def
templates
end
def
ci_cd
end
def
reporting
end
def
metrics_and_profiling
end
def
network
end
def
geo
end
def
preferences
end
def
update
successful
=
ApplicationSettings
::
UpdateService
.
new
(
@application_setting
,
current_user
,
application_setting_params
)
...
...
@@ -19,7 +41,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
session
[
:ask_for_usage_stats_consent
]
=
current_user
.
requires_usage_stats_consent?
end
redirect_path
=
re
quest
.
referer
.
presence
?
URI
(
request
.
referer
).
path
:
admin_application_settings_path
redirect_path
=
re
ferer_path
(
request
)
||
admin_application_settings_path
respond_to
do
|
format
|
if
successful
...
...
app/controllers/concerns/internal_redirect.rb
View file @
df9cb930
...
...
@@ -36,4 +36,10 @@ module InternalRedirect
path_with_query
=
[
uri
.
path
,
uri
.
query
].
compact
.
join
(
'?'
)
[
path_with_query
,
uri
.
fragment
].
compact
.
join
(
"#"
)
end
def
referer_path
(
request
)
return
unless
request
.
referer
.
presence
URI
(
request
.
referer
).
path
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment