_default.html.haml 4.59 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

Clement Ho's avatar
Clement Ho committed
8
%header.navbar.navbar-gitlab.qa-navbar.navbar-expand-sm
9
  %a.sr-only.gl-accessibility{ href: "#content-body", tabindex: "1" } Skip to content
10
  .container-fluid
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

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)
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)
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)
54
                %span.badge.badge-pill.todos-count{ class: ('hidden' if todos_pending_count.zero?) }
55
                  = todos_count_format(todos_pending_count)
56
          - if header_link?(:user_dropdown)
57
            %li.nav-item.header-user.dropdown
58
              = link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do
Clement Ho's avatar
Clement Ho committed
59
                = image_tag avatar_icon_for_user(current_user, 23), width: 23, height: 23, class: "header-user-avatar qa-user-avatar"
60
                = sprite_icon('angle-down', css_class: 'caret-down')
Clement Ho's avatar
Clement Ho committed
61
              .dropdown-menu.dropdown-menu-right
62
                = render 'layouts/header/current_user_dropdown'
63
          - if header_link?(:admin_impersonation)
64
            %li.nav-item.impersonation
65
              = 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
66 67
                = icon('user-secret')
          - if header_link?(:sign_in)
68
            %li.nav-item
69
              %div
70
                - sign_in_text = allow_signup? ? _('Sign in / Register') : _('Sign in')
71
                = link_to "Sign in", omniauth_authorize_path(:user, :cas3), method: :post, class: 'btn btn-sign-in', "data-no-turbolink" => "true"
72

73
      %button.navbar-toggler.d-block.d-sm-none{ type: 'button' }
74
        %span.sr-only= _('Toggle navigation')
75
        = sprite_icon('ellipsis_h', size: 12, css_class: 'more-icon js-navbar-toggle-right')
76
        = sprite_icon('close', size: 12, css_class: 'close-icon js-navbar-toggle-left')