Commit a7ed65f5 authored by Lukas Eipert's avatar Lukas Eipert Committed by Rémy Coutable

Backport code from gitlab-ee!6182

parent 88ceef87
...@@ -350,13 +350,17 @@ module ProjectsHelper ...@@ -350,13 +350,17 @@ module ProjectsHelper
if allowed_protocols_present? if allowed_protocols_present?
enabled_protocol enabled_protocol
else else
extra_default_clone_protocol
end
end
def extra_default_clone_protocol
if !current_user || current_user.require_ssh_key? if !current_user || current_user.require_ssh_key?
gitlab_config.protocol gitlab_config.protocol
else else
'ssh' 'ssh'
end end
end end
end
def project_last_activity(project) def project_last_activity(project)
if project.last_activity_at if project.last_activity_at
...@@ -501,4 +505,37 @@ module ProjectsHelper ...@@ -501,4 +505,37 @@ module ProjectsHelper
"list-label" "list-label"
end end
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 end
...@@ -34,8 +34,10 @@ ...@@ -34,8 +34,10 @@
= link_to project_cycle_analytics_path(@project), title: _('Cycle Analytics'), class: 'shortcuts-project-cycle-analytics' do = link_to project_cycle_analytics_path(@project), title: _('Cycle Analytics'), class: 'shortcuts-project-cycle-analytics' do
%span= _('Cycle Analytics') %span= _('Cycle Analytics')
= render_if_exists 'projects/sidebar/security_dashboard'
- if project_nav_tab? :files - 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 = link_to project_tree_path(@project), class: 'shortcuts-tree' do
.nav-icon-container .nav-icon-container
= sprite_icon('doc_text') = sprite_icon('doc_text')
...@@ -43,7 +45,7 @@ ...@@ -43,7 +45,7 @@
= _('Repository') = _('Repository')
%ul.sidebar-sub-level-items %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 = link_to project_tree_path(@project) do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Repository') = _('Repository')
...@@ -80,6 +82,8 @@ ...@@ -80,6 +82,8 @@
= link_to charts_project_graph_path(@project, current_ref) do = link_to charts_project_graph_path(@project, current_ref) do
= _('Charts') = _('Charts')
= render_if_exists 'projects/sidebar/repository_locked_files'
- if project_nav_tab? :issues - if project_nav_tab? :issues
= nav_link(controller: @project.issues_enabled? ? [:issues, :labels, :milestones, :boards] : :issues) do = nav_link(controller: @project.issues_enabled? ? [:issues, :labels, :milestones, :boards] : :issues) do
= link_to project_issues_path(@project), class: 'shortcuts-issues' do = link_to project_issues_path(@project), class: 'shortcuts-issues' do
...@@ -92,7 +96,7 @@ ...@@ -92,7 +96,7 @@
= number_with_delimiter(@project.open_issues_count(current_user)) = number_with_delimiter(@project.open_issues_count(current_user))
%ul.sidebar-sub-level-items %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 = link_to project_issues_path(@project) do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Issues') = _('Issues')
...@@ -115,6 +119,8 @@ ...@@ -115,6 +119,8 @@
%span %span
= _('Labels') = _('Labels')
= render_if_exists 'projects/sidebar/issues_service_desk'
= nav_link(controller: :milestones) do = nav_link(controller: :milestones) do
= link_to project_milestones_path(@project), title: 'Milestones' do = link_to project_milestones_path(@project), title: 'Milestones' do
%span %span
...@@ -278,7 +284,7 @@ ...@@ -278,7 +284,7 @@
= _('Snippets') = _('Snippets')
- if project_nav_tab? :settings - 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 = link_to edit_project_path(@project), class: 'shortcuts-tree' do
.nav-icon-container .nav-icon-container
= sprite_icon('settings') = sprite_icon('settings')
...@@ -288,7 +294,7 @@ ...@@ -288,7 +294,7 @@
%ul.sidebar-sub-level-items %ul.sidebar-sub-level-items
- can_edit = can?(current_user, :admin_project, @project) - can_edit = can?(current_user, :admin_project, @project)
- if can_edit - 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 = link_to edit_project_path(@project) do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Settings') = _('Settings')
...@@ -326,6 +332,8 @@ ...@@ -326,6 +332,8 @@
%span %span
= _('Pages') = _('Pages')
= render_if_exists 'projects/sidebar/settings_audit_events'
- else - else
= nav_link(controller: :project_members) do = nav_link(controller: :project_members) do
= link_to project_settings_members_path(@project), title: 'Members', class: 'shortcuts-tree' do = link_to project_settings_members_path(@project), title: 'Members', class: 'shortcuts-tree' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment