debian-mirror-gitlab/app/views/layouts/nav/_dashboard.html.haml

91 lines
5.2 KiB
Text
Raw Normal View History

2021-06-08 01:23:25 +05:30
-# WARNING! This file is slated to be removed along with the `combined_menu`
-# feature flag. The logic here will be migrated to an upcoming `top_nav_helper`.
-# Please see [this MR][1] for more context.
-# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587
2018-03-17 18:26:18 +05:30
%ul.list-unstyled.navbar-sub-nav
2018-03-27 19:54:05 +05:30
- if dashboard_nav_link?(:projects)
2021-04-29 21:17:54 +05:30
= 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_experiment: "new_repo" } }) do
2021-01-03 14:25:43 +05:30
%button{ type: 'button', data: { toggle: "dropdown" } }
2018-11-18 11:00:15 +05:30
= _('Projects')
2021-01-03 14:25:43 +05:30
= sprite_icon('chevron-down', css_class: 'caret-down')
2018-11-08 19:23:39 +05:30
.dropdown-menu.frequent-items-dropdown-menu
2018-03-27 19:54:05 +05:30
= render "layouts/nav/projects_dropdown/show"
2018-03-17 18:26:18 +05:30
2018-03-27 19:54:05 +05:30
- if dashboard_nav_link?(:groups)
2021-01-29 00:20:46 +05:30
= 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" } }) do
2021-01-03 14:25:43 +05:30
%button{ type: 'button', data: { toggle: "dropdown" } }
2018-11-18 11:00:15 +05:30
= _('Groups')
2021-01-03 14:25:43 +05:30
= sprite_icon('chevron-down', css_class: 'caret-down')
2018-11-08 19:23:39 +05:30
.dropdown-menu.frequent-items-dropdown-menu
= render "layouts/nav/groups_dropdown/show"
2018-03-17 18:26:18 +05:30
2018-03-27 19:54:05 +05:30
- if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets])
2021-01-29 00:20:46 +05:30
= nav_link(html_options: { id: 'nav-more-dropdown', class: "header-more dropdown", data: { track_label: "more_dropdown", track_event: "click_more_link" } }) do
2019-12-21 20:55:43 +05:30
%a{ href: "#", data: { toggle: "dropdown", qa_selector: 'more_dropdown' } }
2018-11-18 11:00:15 +05:30
= _('More')
2021-01-03 14:25:43 +05:30
= sprite_icon('chevron-down', css_class: 'caret-down')
2018-03-27 19:54:05 +05:30
.dropdown-menu
%ul
2019-12-21 20:55:43 +05:30
- if dashboard_nav_link?(:groups)
%li.d-md-none
2020-07-28 23:09:34 +05:30
= link_to dashboard_groups_path, class: 'dashboard-shortcuts-groups', data: { qa_selector: 'groups_link' } do
2019-12-21 20:55:43 +05:30
= _('Groups')
2018-03-27 19:54:05 +05:30
- if dashboard_nav_link?(:activity)
= nav_link(path: 'dashboard#activity') do
2020-07-28 23:09:34 +05:30
= link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity', data: { qa_selector: 'activity_link' } do
2018-11-18 11:00:15 +05:30
= _('Activity')
2018-03-17 18:26:18 +05:30
2018-03-27 19:54:05 +05:30
- if dashboard_nav_link?(:milestones)
= nav_link(controller: 'dashboard/milestones') do
2020-07-28 23:09:34 +05:30
= link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones', data: { qa_selector: 'milestones_link' } do
2018-11-18 11:00:15 +05:30
= _('Milestones')
2018-03-17 18:26:18 +05:30
2018-03-27 19:54:05 +05:30
- if dashboard_nav_link?(:snippets)
= nav_link(controller: 'dashboard/snippets') do
2019-12-21 20:55:43 +05:30
= link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets', data: { qa_selector: 'snippets_link' } do
2018-11-18 11:00:15 +05:30
= _('Snippets')
2019-10-12 21:52:04 +05:30
2019-12-21 20:55:43 +05:30
%li.dropdown
= render_if_exists 'dashboard/nav_link_list'
2020-03-13 15:44:24 +05:30
2019-02-15 15:39:39 +05:30
- if current_user.admin?
= nav_link(controller: 'admin/dashboard') do
2019-12-21 20:55:43 +05:30
= link_to admin_root_path, class: 'admin-icon qa-admin-area-link d-xl-none' do
2019-02-15 15:39:39 +05:30
= _('Admin Area')
2021-04-29 21:17:54 +05:30
- if Gitlab::CurrentSettings.admin_mode
2019-12-26 22:10:19 +05:30
- if header_link?(:admin_mode)
= nav_link(controller: 'admin/sessions') do
2020-03-13 15:44:24 +05:30
= link_to destroy_admin_session_path, method: :post, class: 'd-lg-none lock-open-icon' do
2019-12-26 22:10:19 +05:30
= _('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')
2019-02-15 15:39:39 +05:30
- if Gitlab::Sherlock.enabled?
%li
2019-12-21 20:55:43 +05:30
= link_to sherlock_transactions_path, class: 'admin-icon' do
2019-02-15 15:39:39 +05:30
= _('Sherlock Transactions')
2019-12-21 20:55:43 +05:30
- 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)
2021-04-29 21:17:54 +05:30
- if Gitlab::CurrentSettings.admin_mode
2019-12-26 22:10:19 +05:30
- if header_link?(:admin_mode)
2021-01-29 00:20:46 +05:30
= nav_link(controller: 'admin/sessions', html_options: { class: "d-none d-lg-block"}) do
2020-03-13 15:44:24 +05:30
= 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-12-26 22:10:19 +05:30
= sprite_icon('lock-open', size: 18)
- elsif current_user.admin?
2021-01-29 00:20:46 +05:30
= nav_link(controller: 'admin/sessions', html_options: { class: "d-none d-lg-block"}) do
2019-12-26 22:10:19 +05:30
= 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-12-21 20:55:43 +05:30
2018-03-17 18:26:18 +05:30
-# Shortcut to Dashboard > Projects
2018-03-27 19:54:05 +05:30
- if dashboard_nav_link?(:projects)
%li.hidden
2019-09-04 21:01:54 +05:30
= link_to dashboard_projects_path, class: 'dashboard-shortcuts-projects' do
2018-11-18 11:00:15 +05:30
= _('Projects')
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
= render_if_exists 'layouts/nav/geo_primary_node_url'