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
a7ed65f5
Commit
a7ed65f5
authored
Jun 20, 2018
by
Lukas Eipert
Committed by
Rémy Coutable
Jun 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport code from gitlab-ee!6182
parent
88ceef87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
10 deletions
+55
-10
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+42
-5
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+13
-5
No files found.
app/helpers/projects_helper.rb
View file @
a7ed65f5
...
...
@@ -350,11 +350,15 @@ module ProjectsHelper
if
allowed_protocols_present?
enabled_protocol
else
if
!
current_user
||
current_user
.
require_ssh_key?
gitlab_config
.
protocol
else
'ssh'
end
extra_default_clone_protocol
end
end
def
extra_default_clone_protocol
if
!
current_user
||
current_user
.
require_ssh_key?
gitlab_config
.
protocol
else
'ssh'
end
end
...
...
@@ -501,4 +505,37 @@ module ProjectsHelper
"list-label"
end
end
def
sidebar_settings_paths
%w[
projects#edit
project_members#index
integrations#show
services#edit
repository#show
ci_cd#show
badges#index
pages#show
]
end
def
sidebar_repository_paths
%w[
tree
blob
blame
edit_tree
new_tree
find_file
commit
commits
compare
projects/repositories
tags
branches
releases
graphs
network
]
end
end
app/views/layouts/nav/sidebar/_project.html.haml
View file @
a7ed65f5
...
...
@@ -34,8 +34,10 @@
=
link_to
project_cycle_analytics_path
(
@project
),
title:
_
(
'Cycle Analytics'
),
class:
'shortcuts-project-cycle-analytics'
do
%span
=
_
(
'Cycle Analytics'
)
=
render_if_exists
'projects/sidebar/security_dashboard'
-
if
project_nav_tab?
:files
=
nav_link
(
controller:
%w(tree blob blame edit_tree new_tree find_file commit commits compare projects/repositories tags branches releases graphs network)
)
do
=
nav_link
(
controller:
sidebar_repository_paths
)
do
=
link_to
project_tree_path
(
@project
),
class:
'shortcuts-tree'
do
.nav-icon-container
=
sprite_icon
(
'doc_text'
)
...
...
@@ -43,7 +45,7 @@
=
_
(
'Repository'
)
%ul
.sidebar-sub-level-items
=
nav_link
(
controller:
%w(tree blob blame edit_tree new_tree find_file commit commits compare projects/repositories tags branches releases graphs network)
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
nav_link
(
controller:
sidebar_repository_paths
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
project_tree_path
(
@project
)
do
%strong
.fly-out-top-item-name
=
_
(
'Repository'
)
...
...
@@ -80,6 +82,8 @@
=
link_to
charts_project_graph_path
(
@project
,
current_ref
)
do
=
_
(
'Charts'
)
=
render_if_exists
'projects/sidebar/repository_locked_files'
-
if
project_nav_tab?
:issues
=
nav_link
(
controller:
@project
.
issues_enabled?
?
[
:issues
,
:labels
,
:milestones
,
:boards
]
:
:issues
)
do
=
link_to
project_issues_path
(
@project
),
class:
'shortcuts-issues'
do
...
...
@@ -92,7 +96,7 @@
=
number_with_delimiter
(
@project
.
open_issues_count
(
current_user
))
%ul
.sidebar-sub-level-items
=
nav_link
(
controller: :issues
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
nav_link
(
controller: :issues
,
action: :index
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
project_issues_path
(
@project
)
do
%strong
.fly-out-top-item-name
=
_
(
'Issues'
)
...
...
@@ -115,6 +119,8 @@
%span
=
_
(
'Labels'
)
=
render_if_exists
'projects/sidebar/issues_service_desk'
=
nav_link
(
controller: :milestones
)
do
=
link_to
project_milestones_path
(
@project
),
title:
'Milestones'
do
%span
...
...
@@ -278,7 +284,7 @@
=
_
(
'Snippets'
)
-
if
project_nav_tab?
:settings
=
nav_link
(
path:
%w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show badges#index pages#show]
)
do
=
nav_link
(
path:
sidebar_settings_paths
)
do
=
link_to
edit_project_path
(
@project
),
class:
'shortcuts-tree'
do
.nav-icon-container
=
sprite_icon
(
'settings'
)
...
...
@@ -288,7 +294,7 @@
%ul
.sidebar-sub-level-items
-
can_edit
=
can?
(
current_user
,
:admin_project
,
@project
)
-
if
can_edit
=
nav_link
(
path:
%w[projects#edit project_members#index integrations#show services#edit repository#show ci_cd#show badges#index pages#show]
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
nav_link
(
path:
sidebar_settings_paths
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
edit_project_path
(
@project
)
do
%strong
.fly-out-top-item-name
=
_
(
'Settings'
)
...
...
@@ -326,6 +332,8 @@
%span
=
_
(
'Pages'
)
=
render_if_exists
'projects/sidebar/settings_audit_events'
-
else
=
nav_link
(
controller: :project_members
)
do
=
link_to
project_settings_members_path
(
@project
),
title:
'Members'
,
class:
'shortcuts-tree'
do
...
...
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