2019-12-04 20:38:33 +05:30
|
|
|
- has_impersonation_link = header_link?(:admin_impersonation)
|
2021-01-29 00:20:46 +05:30
|
|
|
- user_status_data = user_status_properties(current_user)
|
2018-11-20 20:47:30 +05:30
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
%header.navbar.navbar-gitlab.navbar-expand-sm.js-navbar{ data: { qa_selector: 'navbar' } }
|
2017-08-17 22:00:37 +05:30
|
|
|
%a.sr-only.gl-accessibility{ href: "#content-body", tabindex: "1" } Skip to content
|
|
|
|
.container-fluid
|
2015-09-11 14:41:01 +05:30
|
|
|
.header-content
|
2018-03-17 18:26:18 +05:30
|
|
|
.title-container
|
|
|
|
%h1.title
|
2020-06-23 00:09:42 +05:30
|
|
|
%span.gl-sr-only GitLab
|
2020-10-24 23:57:45 +05:30
|
|
|
= link_to root_path, title: _('Dashboard'), id: 'logo', **tracking_attrs('main_navigation', 'click_gitlab_logo_link', 'navigation') do
|
2018-03-17 18:26:18 +05:30
|
|
|
= brand_header_logo
|
|
|
|
- logo_text = brand_header_logo_type
|
|
|
|
- if logo_text.present?
|
2020-06-23 00:09:42 +05:30
|
|
|
%span.logo-text.d-none.d-lg-block.gl-ml-3
|
2018-03-17 18:26:18 +05:30
|
|
|
= logo_text
|
2019-12-26 22:10:19 +05:30
|
|
|
- if Gitlab.com_and_canary?
|
2021-01-03 14:25:43 +05:30
|
|
|
= link_to 'https://next.gitlab.com', class: 'canary-badge bg-transparent', target: :_blank do
|
2019-07-31 22:56:46 +05:30
|
|
|
%span.color-label.has-tooltip.badge.badge-pill.green-badge
|
|
|
|
= _('Next')
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
- if current_user
|
|
|
|
= render "layouts/nav/dashboard"
|
|
|
|
- else
|
|
|
|
= render "layouts/nav/explore"
|
2015-09-11 14:41:01 +05:30
|
|
|
|
|
|
|
.navbar-collapse.collapse
|
2016-06-02 11:05:42 +05:30
|
|
|
%ul.nav.navbar-nav
|
2018-03-17 18:26:18 +05:30
|
|
|
- if current_user
|
|
|
|
= render 'layouts/header/new_dropdown'
|
2018-03-27 19:54:05 +05:30
|
|
|
- if header_link?(:search)
|
2019-12-21 20:55:43 +05:30
|
|
|
%li.nav-item.d-none.d-lg-block.m-auto
|
2018-03-27 19:54:05 +05:30
|
|
|
= render 'layouts/search' unless current_controller?(:search)
|
2019-12-21 20:55:43 +05:30
|
|
|
%li.nav-item.d-inline-block.d-lg-none
|
2020-06-23 00:09:42 +05:30
|
|
|
= link_to search_context.search_url, title: _('Search'), aria: { label: _('Search') }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
|
2020-10-24 23:57:45 +05:30
|
|
|
= sprite_icon('search')
|
2018-03-27 19:54:05 +05:30
|
|
|
- if header_link?(:issues)
|
2018-03-17 18:26:18 +05:30
|
|
|
= nav_link(path: 'dashboard#issues', html_options: { class: "user-counter" }) do
|
2020-10-24 23:57:45 +05:30
|
|
|
= link_to assigned_issues_dashboard_path, title: _('Issues'), class: 'dashboard-shortcuts-issues', aria: { label: _('Issues') },
|
|
|
|
data: { qa_selector: 'issues_shortcut_button', toggle: 'tooltip', placement: 'bottom',
|
|
|
|
track_label: 'main_navigation',
|
|
|
|
track_event: 'click_issues_link',
|
|
|
|
track_property: 'navigation',
|
|
|
|
container: 'body' } do
|
|
|
|
= sprite_icon('issues')
|
2017-08-17 22:00:37 +05:30
|
|
|
- issues_count = assigned_issuables_count(:issues)
|
2020-10-24 23:57:45 +05:30
|
|
|
%span.badge.badge-pill.issues-count.green-badge{ class: ('hidden' if issues_count == 0) }
|
2017-08-17 22:00:37 +05:30
|
|
|
= number_with_delimiter(issues_count)
|
2018-03-27 19:54:05 +05:30
|
|
|
- if header_link?(:merge_requests)
|
2018-03-17 18:26:18 +05:30
|
|
|
= nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter" }) do
|
2020-10-24 23:57:45 +05:30
|
|
|
= link_to assigned_mrs_dashboard_path, title: _('Merge requests'), class: 'dashboard-shortcuts-merge_requests', aria: { label: _('Merge requests') },
|
|
|
|
data: { qa_selector: 'merge_requests_shortcut_button', toggle: 'tooltip', placement: 'bottom',
|
|
|
|
track_label: 'main_navigation',
|
|
|
|
track_event: 'click_merge_link',
|
|
|
|
track_property: 'navigation',
|
|
|
|
container: 'body' } do
|
|
|
|
= sprite_icon('git-merge')
|
2017-08-17 22:00:37 +05:30
|
|
|
- merge_requests_count = assigned_issuables_count(:merge_requests)
|
2020-10-24 23:57:45 +05:30
|
|
|
%span.badge.badge-pill.merge-requests-count{ class: ('hidden' if merge_requests_count == 0) }
|
2017-08-17 22:00:37 +05:30
|
|
|
= number_with_delimiter(merge_requests_count)
|
2018-03-27 19:54:05 +05:30
|
|
|
- if header_link?(:todos)
|
2018-03-17 18:26:18 +05:30
|
|
|
= nav_link(controller: 'dashboard/todos', html_options: { class: "user-counter" }) do
|
2020-10-24 23:57:45 +05:30
|
|
|
= link_to dashboard_todos_path, title: _('To-Do List'), aria: { label: _('To-Do List') }, class: 'shortcuts-todos',
|
|
|
|
data: { qa_selector: 'todos_shortcut_button', toggle: 'tooltip', placement: 'bottom',
|
|
|
|
track_label: 'main_navigation',
|
|
|
|
track_event: 'click_to_do_link',
|
|
|
|
track_property: 'navigation',
|
|
|
|
container: 'body' } do
|
|
|
|
= sprite_icon('todo-done')
|
2020-11-24 15:15:51 +05:30
|
|
|
%span.badge.badge-pill.todos-count.js-todos-count{ class: ('hidden' if todos_pending_count == 0) }
|
2017-08-17 22:00:37 +05:30
|
|
|
= todos_count_format(todos_pending_count)
|
2020-10-24 23:57:45 +05:30
|
|
|
%li.nav-item.header-help.dropdown.d-none.d-md-block{ **tracking_attrs('main_navigation', 'click_question_mark_link', 'navigation') }
|
2018-12-13 13:39:08 +05:30
|
|
|
= link_to help_path, class: 'header-help-dropdown-toggle', data: { toggle: "dropdown" } do
|
2020-06-23 00:09:42 +05:30
|
|
|
%span.gl-sr-only
|
|
|
|
= s_('Nav|Help')
|
2020-10-24 23:57:45 +05:30
|
|
|
= sprite_icon('question')
|
2021-02-22 17:27:13 +05:30
|
|
|
%span.notification-dot.rounded-circle.gl-absolute
|
2021-01-03 14:25:43 +05:30
|
|
|
= sprite_icon('chevron-down', css_class: 'caret-down')
|
2018-12-13 13:39:08 +05:30
|
|
|
.dropdown-menu.dropdown-menu-right
|
|
|
|
= render 'layouts/header/help_dropdown'
|
2018-03-27 19:54:05 +05:30
|
|
|
- if header_link?(:user_dropdown)
|
2020-04-22 19:07:51 +05:30
|
|
|
%li.nav-item.header-user.js-nav-user-dropdown.dropdown{ data: { track_label: "profile_dropdown", track_event: "click_dropdown", track_value: "", qa_selector: 'user_menu' }, class: ('mr-0' if has_impersonation_link) }
|
2018-03-17 18:26:18 +05:30
|
|
|
= link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do
|
2020-06-23 00:09:42 +05:30
|
|
|
= image_tag avatar_icon_for_user(current_user, 23), width: 23, height: 23, class: "header-user-avatar qa-user-avatar", alt: current_user.name
|
2020-04-22 19:07:51 +05:30
|
|
|
= render_if_exists 'layouts/header/user_notification_dot', project: project, namespace: group
|
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.dropdown-menu-right
|
2018-10-15 14:42:47 +05:30
|
|
|
= render 'layouts/header/current_user_dropdown'
|
2019-12-04 20:38:33 +05:30
|
|
|
- if has_impersonation_link
|
|
|
|
%li.nav-item.impersonation.ml-0
|
2019-12-21 20:55:43 +05:30
|
|
|
= link_to admin_impersonation_path, class: 'nav-link impersonation-btn', method: :delete, title: _('Stop impersonation'), aria: { label: _('Stop impersonation') }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body', qa_selector: 'stop_impersonation_link' } do
|
2020-11-24 15:15:51 +05:30
|
|
|
= sprite_icon('incognito', size: 18)
|
2018-03-27 19:54:05 +05:30
|
|
|
- if header_link?(:sign_in)
|
2019-02-15 15:39:39 +05:30
|
|
|
%li.nav-item
|
2016-06-02 11:05:42 +05:30
|
|
|
%div
|
2018-11-18 11:00:15 +05:30
|
|
|
- sign_in_text = allow_signup? ? _('Sign in / Register') : _('Sign in')
|
|
|
|
= link_to sign_in_text, new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in'
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
%button.navbar-toggler.d-block.d-sm-none{ type: 'button' }
|
2018-11-20 20:47:30 +05:30
|
|
|
%span.sr-only= _('Toggle navigation')
|
2018-11-18 11:00:15 +05:30
|
|
|
= sprite_icon('ellipsis_h', size: 12, css_class: 'more-icon js-navbar-toggle-right')
|
2018-03-17 18:26:18 +05:30
|
|
|
= sprite_icon('close', size: 12, css_class: 'close-icon js-navbar-toggle-left')
|
2018-12-05 23:21:45 +05:30
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
- if ::Feature.enabled?(:whats_new_drawer, current_user)
|
2021-02-22 17:27:13 +05:30
|
|
|
#whats-new-app{ data: { storage_key: whats_new_storage_key, versions: whats_new_versions, gitlab_dot_com: Gitlab.dev_env_org_or_com? } }
|
2020-10-24 23:57:45 +05:30
|
|
|
|
2018-12-05 23:21:45 +05:30
|
|
|
- if can?(current_user, :update_user_status, current_user)
|
2021-01-29 00:20:46 +05:30
|
|
|
.js-set-status-modal-wrapper{ data: user_status_data }
|