2018-11-26 11:38:34 +00:00
|
|
|
-# WAIT! Before adding more items to the nav bar, please see
|
2019-09-18 14:02:45 +00:00
|
|
|
-# https://gitlab.com/gitlab-org/gitlab-foss/issues/49713 for more information.
|
2017-09-06 10:58:24 +00:00
|
|
|
%ul.list-unstyled.navbar-sub-nav
|
2017-12-11 14:21:06 +00:00
|
|
|
- if dashboard_nav_link?(:projects)
|
2019-07-16 12:44:15 +00:00
|
|
|
= nav_link(path: ['root#index', 'projects#trending', 'projects#starred', 'dashboard/projects#index'], html_options: { id: 'nav-projects-dropdown', class: "home dropdown header-projects qa-projects-dropdown", data: { track_label: "projects_dropdown", track_event: "click_dropdown", track_value: "" } }) do
|
2019-03-20 00:04:21 +00:00
|
|
|
%button.btn{ type: 'button', data: { toggle: "dropdown" } }
|
2018-06-13 06:30:40 +00:00
|
|
|
= _('Projects')
|
2017-12-11 14:21:06 +00:00
|
|
|
= sprite_icon('angle-down', css_class: 'caret-down')
|
2018-07-06 13:40:11 +00:00
|
|
|
.dropdown-menu.frequent-items-dropdown-menu
|
2017-12-11 14:21:06 +00:00
|
|
|
= render "layouts/nav/projects_dropdown/show"
|
2017-09-06 10:58:24 +00:00
|
|
|
|
2017-12-11 14:21:06 +00:00
|
|
|
- if dashboard_nav_link?(:groups)
|
2019-09-26 15:06:18 +00:00
|
|
|
= nav_link(controller: ['dashboard/groups', 'explore/groups'], html_options: { id: 'nav-groups-dropdown', class: "d-none d-md-block home dropdown header-groups qa-groups-dropdown", data: { track_label: "groups_dropdown", track_event: "click_dropdown", track_value: "" } }) do
|
2019-03-20 00:04:21 +00:00
|
|
|
%button.btn{ type: 'button', data: { toggle: "dropdown" } }
|
2018-06-13 06:30:40 +00:00
|
|
|
= _('Groups')
|
2018-07-06 13:40:11 +00:00
|
|
|
= sprite_icon('angle-down', css_class: 'caret-down')
|
|
|
|
.dropdown-menu.frequent-items-dropdown-menu
|
|
|
|
= render "layouts/nav/groups_dropdown/show"
|
2017-09-06 10:58:24 +00:00
|
|
|
|
2017-12-11 14:21:06 +00:00
|
|
|
- if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets])
|
2019-09-26 15:06:18 +00:00
|
|
|
%li.header-more.dropdown
|
2019-09-30 12:06:01 +00:00
|
|
|
%a{ href: "#", data: { toggle: "dropdown", qa_selector: 'more_dropdown' } }
|
2018-06-13 06:30:40 +00:00
|
|
|
= _('More')
|
2017-12-11 14:21:06 +00:00
|
|
|
= sprite_icon('angle-down', css_class: 'caret-down')
|
|
|
|
.dropdown-menu
|
|
|
|
%ul
|
2019-09-26 15:06:18 +00:00
|
|
|
- if dashboard_nav_link?(:groups)
|
|
|
|
%li.d-md-none
|
2020-04-14 21:09:52 +00:00
|
|
|
= link_to dashboard_groups_path, class: 'dashboard-shortcuts-groups' do
|
2019-09-26 15:06:18 +00:00
|
|
|
= _('Groups')
|
2017-12-11 14:21:06 +00:00
|
|
|
- if dashboard_nav_link?(:activity)
|
|
|
|
= nav_link(path: 'dashboard#activity') do
|
2020-04-09 12:09:24 +00:00
|
|
|
= link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity' do
|
2018-06-13 06:30:40 +00:00
|
|
|
= _('Activity')
|
2017-09-06 10:58:24 +00:00
|
|
|
|
2017-12-11 14:21:06 +00:00
|
|
|
- if dashboard_nav_link?(:milestones)
|
|
|
|
= nav_link(controller: 'dashboard/milestones') do
|
2019-06-05 23:21:22 +00:00
|
|
|
= link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones' do
|
2018-06-13 06:30:40 +00:00
|
|
|
= _('Milestones')
|
2017-09-06 10:58:24 +00:00
|
|
|
|
2017-12-11 14:21:06 +00:00
|
|
|
- if dashboard_nav_link?(:snippets)
|
|
|
|
= nav_link(controller: 'dashboard/snippets') do
|
2019-09-30 12:06:01 +00:00
|
|
|
= link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets', data: { qa_selector: 'snippets_link' } do
|
2018-06-13 06:30:40 +00:00
|
|
|
= _('Snippets')
|
2019-07-03 18:29:17 +00:00
|
|
|
|
2019-10-02 18:06:20 +00:00
|
|
|
= render_if_exists 'layouts/nav/sidebar/analytics_link'
|
2019-07-03 18:29:17 +00:00
|
|
|
|
2019-09-26 15:06:18 +00:00
|
|
|
%li.dropdown
|
2019-09-25 18:06:17 +00:00
|
|
|
= render_if_exists 'dashboard/nav_link_list'
|
2019-12-18 18:08:04 +00:00
|
|
|
|
2018-11-26 11:38:34 +00:00
|
|
|
- if current_user.admin?
|
|
|
|
= nav_link(controller: 'admin/dashboard') do
|
2019-09-26 15:06:18 +00:00
|
|
|
= link_to admin_root_path, class: 'admin-icon qa-admin-area-link d-xl-none' do
|
2018-11-26 11:38:34 +00:00
|
|
|
= _('Admin Area')
|
2019-10-21 12:06:14 +00:00
|
|
|
- if Feature.enabled?(:user_mode_in_session)
|
|
|
|
- if header_link?(:admin_mode)
|
|
|
|
= nav_link(controller: 'admin/sessions') do
|
2020-01-14 12:07:41 +00:00
|
|
|
= link_to destroy_admin_session_path, method: :post, class: 'd-lg-none lock-open-icon' do
|
2019-10-21 12:06:14 +00:00
|
|
|
= _('Leave Admin Mode')
|
|
|
|
- elsif current_user.admin?
|
|
|
|
= nav_link(controller: 'admin/sessions') do
|
|
|
|
= link_to new_admin_session_path, class: 'd-lg-none lock-icon' do
|
|
|
|
= _('Enter Admin Mode')
|
2018-11-26 11:38:34 +00:00
|
|
|
- if Gitlab::Sherlock.enabled?
|
|
|
|
%li
|
2019-09-26 15:06:18 +00:00
|
|
|
= link_to sherlock_transactions_path, class: 'admin-icon' do
|
2018-11-26 11:38:34 +00:00
|
|
|
= _('Sherlock Transactions')
|
|
|
|
|
2019-12-18 18:08:04 +00:00
|
|
|
= render_if_exists 'layouts/nav/analytics_link'
|
|
|
|
|
2019-09-26 15:06:18 +00:00
|
|
|
- if current_user.admin?
|
|
|
|
= nav_link(controller: 'admin/dashboard', html_options: { class: "d-none d-xl-block"}) do
|
|
|
|
= link_to admin_root_path, class: 'admin-icon qa-admin-area-link', title: _('Admin Area'), aria: { label: _('Admin Area') }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
|
|
|
|
= sprite_icon('admin', size: 18)
|
|
|
|
|
2019-10-21 12:06:14 +00:00
|
|
|
- if Feature.enabled?(:user_mode_in_session)
|
|
|
|
- if header_link?(:admin_mode)
|
|
|
|
= nav_link(controller: 'admin/sessions', html_options: { class: "d-none d-lg-block d-xl-block"}) do
|
2020-01-21 15:08:26 +00:00
|
|
|
= link_to destroy_admin_session_path, method: :post, title: _('Leave Admin Mode'), aria: { label: _('Leave Admin Mode') }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
|
2019-10-21 12:06:14 +00:00
|
|
|
= sprite_icon('lock-open', size: 18)
|
|
|
|
- elsif current_user.admin?
|
|
|
|
= nav_link(controller: 'admin/sessions', html_options: { class: "d-none d-lg-block d-xl-block"}) do
|
|
|
|
= link_to new_admin_session_path, title: _('Enter Admin Mode'), aria: { label: _('Enter Admin Mode') }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
|
|
|
|
= sprite_icon('lock', size: 18)
|
2019-09-26 15:06:18 +00:00
|
|
|
|
2017-09-06 10:58:24 +00:00
|
|
|
-# Shortcut to Dashboard > Projects
|
2017-12-11 14:21:06 +00:00
|
|
|
- if dashboard_nav_link?(:projects)
|
|
|
|
%li.hidden
|
2019-06-05 23:21:22 +00:00
|
|
|
= link_to dashboard_projects_path, class: 'dashboard-shortcuts-projects' do
|
2018-06-13 06:30:40 +00:00
|
|
|
= _('Projects')
|
2017-09-06 10:58:24 +00:00
|
|
|
|
2019-05-08 05:26:10 +00:00
|
|
|
= render_if_exists 'layouts/nav/geo_primary_node_url'
|