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
8dd3b2b5
Commit
8dd3b2b5
authored
Dec 07, 2018
by
Filipa Lacerda
Committed by
Matija Čupić
Dec 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates operations link based on permissions
parent
e78c35bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
+11
-7
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+4
-0
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+2
-7
ee/app/helpers/ee/projects_helper.rb
ee/app/helpers/ee/projects_helper.rb
+5
-0
No files found.
app/helpers/projects_helper.rb
View file @
8dd3b2b5
...
...
@@ -393,6 +393,10 @@ module ProjectsHelper
end
end
def
sidebar_operations_link_path
(
project
=
@project
)
metrics_project_environments_path
(
project
)
if
can?
(
current_user
,
:read_environment
,
project
)
end
def
project_last_activity
(
project
)
if
project
.
last_activity_at
time_ago_with_tooltip
(
project
.
last_activity_at
,
placement:
'bottom'
,
html_class:
'last_activity_time_ago'
)
...
...
app/views/layouts/nav/sidebar/_project.html.haml
View file @
8dd3b2b5
...
...
@@ -195,13 +195,8 @@
=
_
(
'Charts'
)
-
if
project_nav_tab?
:operations
-
if
can?
(
current_user
,
:read_environment
,
@project
)
||
can?
(
current_user
,
:read_cluster
,
@project
)
-
main_link
=
metrics_project_environments_path
(
@project
)
-
elsif
can?
(
current_user
,
:read_feature_flag
,
@project
)
-
main_link
=
project_feature_flags_path
(
@project
)
=
nav_link
(
controller:
sidebar_operations_paths
)
do
=
link_to
main_link
,
class:
'shortcuts-operations'
do
=
link_to
sidebar_operations_link_path
,
class:
'shortcuts-operations'
do
.nav-icon-container
=
sprite_icon
(
'cloud-gear'
)
%span
.nav-item-name
...
...
@@ -209,7 +204,7 @@
%ul
.sidebar-sub-level-items
=
nav_link
(
controller:
sidebar_operations_paths
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
metrics_project_environments_path
(
@project
)
do
=
link_to
sidebar_operations_link_path
do
%strong
.fly-out-top-item-name
=
_
(
'Operations'
)
%li
.divider.fly-out-top-item
...
...
ee/app/helpers/ee/projects_helper.rb
View file @
8dd3b2b5
...
...
@@ -88,6 +88,11 @@ module EE
end
end
override
:sidebar_operations_link_path
def
sidebar_operations_link_path
(
project
=
@project
)
super
||
project_feature_flags_path
(
project
)
end
# Given the current GitLab configuration, check whether the GitLab URL for Kerberos is going to be different than the HTTP URL
def
alternative_kerberos_url?
::
Gitlab
.
config
.
alternative_gitlab_kerberos_url?
...
...
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