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
7584fa5d
Commit
7584fa5d
authored
Nov 21, 2017
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicate read-only flash message on admin pages
parent
39e52710
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
28 deletions
+5
-28
app/controllers/admin/application_controller.rb
app/controllers/admin/application_controller.rb
+0
-14
changelogs/unreleased-ee/tc-geo-remove-double-banner.yml
changelogs/unreleased-ee/tc-geo-remove-double-banner.yml
+5
-0
ee/app/controllers/ee/admin/application_controller.rb
ee/app/controllers/ee/admin/application_controller.rb
+0
-14
No files found.
app/controllers/admin/application_controller.rb
View file @
7584fa5d
...
...
@@ -3,23 +3,9 @@
# Automatically sets the layout and ensures an administrator is logged in
class
Admin::ApplicationController
<
ApplicationController
before_action
:authenticate_admin!
before_action
:display_read_only_information
layout
'admin'
def
authenticate_admin!
render_404
unless
current_user
.
admin?
end
def
display_read_only_information
return
unless
Gitlab
::
Database
.
read_only?
flash
.
now
[
:notice
]
=
read_only_message
end
private
# Overridden in EE
def
read_only_message
_
(
'You are on a read-only GitLab instance.'
)
end
end
changelogs/unreleased-ee/tc-geo-remove-double-banner.yml
0 → 100644
View file @
7584fa5d
---
title
:
Remove duplicate read-only flash message on admin pages
merge_request
:
3495
author
:
type
:
fixed
ee/app/controllers/ee/admin/application_controller.rb
deleted
100644 → 0
View file @
39e52710
module
EE
module
Admin
module
ApplicationController
def
read_only_message
raise
NotImplementedError
unless
defined?
(
super
)
return
super
unless
Gitlab
::
Geo
.
secondary_with_primary?
link_to_primary_node
=
view_context
.
link_to
(
'primary node'
,
Gitlab
::
Geo
.
primary_node
.
url
)
(
_
(
'You are on a read-only GitLab instance. If you want to make any changes, you must visit the %{link_to_primary_node}.'
)
%
{
link_to_primary_node:
link_to_primary_node
}).
html_safe
end
end
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