_default.html.haml 5.18 KB
Newer Older
1
2
3
4
5
6
7
- if project
  - search_path_url = search_path(project_id: project.id)
- elsif group
  - search_path_url = search_path(group_id: group.id)
- else
  - search_path_url = search_path

8
%header.navbar.navbar-gitlab.qa-navbar.navbar-expand-sm.js-navbar
9
  %a.sr-only.gl-accessibility{ href: "#content-body", tabindex: "1" } Skip to content
10
  .container-fluid
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
11
    .header-content
12
13
      .title-container
        %h1.title
14
          = link_to root_path, title: _('Dashboard'), id: 'logo' do
15
            = brand_header_logo
16
17
            - logo_text = brand_header_logo_type
            - if logo_text.present?
Clement Ho's avatar
Clement Ho committed
18
              %span.logo-text.d-none.d-sm-block
19
                = logo_text
20

21
22
23
24
        - if current_user
          = render "layouts/nav/dashboard"
        - else
          = render "layouts/nav/explore"
25

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
26
      .navbar-collapse.collapse
27
        %ul.nav.navbar-nav
28
29
          - if current_user
            = render 'layouts/header/new_dropdown'
30
          - if header_link?(:search)
31
            %li.nav-item.d-none.d-sm-none.d-md-block.m-auto
32
              = render 'layouts/search' unless current_controller?(:search)
33
            %li.nav-item.d-inline-block.d-sm-none.d-md-none
34
              = link_to search_path_url, title: _('Search'), aria: { label: _('Search') }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
35
36
                = sprite_icon('search', size: 16)
          - if header_link?(:issues)
Clement Ho's avatar
Clement Ho committed
37
            = nav_link(path: 'dashboard#issues', html_options: { class: "user-counter" }) do
38
              = link_to assigned_issues_dashboard_path, title: _('Issues'), class: 'dashboard-shortcuts-issues', aria: { label: _('Issues') }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
39
                = sprite_icon('issues', size: 16)
40
                - issues_count = assigned_issuables_count(:issues)
Clement Ho's avatar
Clement Ho committed
41
                %span.badge.badge-pill.issues-count{ class: ('hidden' if issues_count.zero?) }
42
                  = number_with_delimiter(issues_count)
43
          - if header_link?(:merge_requests)
Clement Ho's avatar
Clement Ho committed
44
            = nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter" }) do
45
              = link_to assigned_mrs_dashboard_path, title: _('Merge requests'), class: 'dashboard-shortcuts-merge_requests', aria: { label: _('Merge requests') }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
46
                = sprite_icon('git-merge', size: 16)
47
                - merge_requests_count = assigned_issuables_count(:merge_requests)
Clement Ho's avatar
Clement Ho committed
48
                %span.badge.badge-pill.merge-requests-count{ class: ('hidden' if merge_requests_count.zero?) }
49
                  = number_with_delimiter(merge_requests_count)
50
          - if header_link?(:todos)
Clement Ho's avatar
Clement Ho committed
51
            = nav_link(controller: 'dashboard/todos', html_options: { class: "user-counter" }) do
52
              = link_to dashboard_todos_path, title: _('Todos'), aria: { label: _('Todos') }, class: 'shortcuts-todos', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
53
                = sprite_icon('todo-done', size: 16)
Clement Ho's avatar
Clement Ho committed
54
                %span.badge.badge-pill.todos-count{ class: ('hidden' if todos_pending_count.zero?) }
55
                  = todos_count_format(todos_pending_count)
56
57
58
59
60
61
          %li.nav-item.header-help.dropdown
            = link_to help_path, class: 'header-help-dropdown-toggle', data: { toggle: "dropdown" } do
              = sprite_icon('question', size: 16)
              = sprite_icon('angle-down', css_class: 'caret-down')
            .dropdown-menu.dropdown-menu-right
              = render 'layouts/header/help_dropdown'
62
          - if header_link?(:user_dropdown)
63
            %li.nav-item.header-user.dropdown
64
              = link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do
Clement Ho's avatar
Clement Ho committed
65
                = image_tag avatar_icon_for_user(current_user, 23), width: 23, height: 23, class: "header-user-avatar qa-user-avatar"
66
                = sprite_icon('angle-down', css_class: 'caret-down')
Clement Ho's avatar
Clement Ho committed
67
              .dropdown-menu.dropdown-menu-right
68
                = render 'layouts/header/current_user_dropdown'
69
          - if header_link?(:admin_impersonation)
70
            %li.nav-item.impersonation
71
              = 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' } do
72
73
                = icon('user-secret')
          - if header_link?(:sign_in)
74
            %li.nav-item
75
              %div
76
                - sign_in_text = allow_signup? ? _('Sign in / Register') : _('Sign in')
77
78
                = link_to sign_in_text, new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in'

79
      %button.navbar-toggler.d-block.d-sm-none{ type: 'button' }
80
        %span.sr-only= _('Toggle navigation')
81
        = sprite_icon('ellipsis_h', size: 12, css_class: 'more-icon js-navbar-toggle-right')
82
        = sprite_icon('close', size: 12, css_class: 'close-icon js-navbar-toggle-left')
83
84
85

- if can?(current_user, :update_user_status, current_user)
  .js-set-status-modal-wrapper{ data: { current_emoji: current_user.status.present? ? current_user.status.emoji : '', current_message: current_user.status.present? ? current_user.status.message : '' } }