_default.html.haml 4.58 KB
Newer Older
1
%header.navbar.navbar-gitlab.qa-navbar
2
  %a.sr-only.gl-accessibility{ href: "#content-body", tabindex: "1" } Skip to content
3
  .container-fluid
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
4
    .header-content
5
6
7
8
      .title-container
        %h1.title
          = link_to root_path, title: 'Dashboard', id: 'logo' do
            = brand_header_logo
9
10
11
12
            - logo_text = brand_header_logo_type
            - if logo_text.present?
              %span.logo-text.hidden-xs
                = logo_text
13

14
15
16
17
        - if current_user
          = render "layouts/nav/dashboard"
        - else
          = render "layouts/nav/explore"
18

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
19
      .navbar-collapse.collapse
20
        %ul.nav.navbar-nav
21
22
          - if current_user
            = render 'layouts/header/new_dropdown'
23
          %li.hidden-sm.hidden-xs
24
            = render 'layouts/search' unless current_controller?(:search)
25
          %li.visible-sm-inline-block.visible-xs-inline-block
Phil Hughes's avatar
Phil Hughes committed
26
            = link_to search_path, title: 'Search', aria: { label: "Search" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
27
              = sprite_icon('search', size: 16)
28
          - if current_user
29
            = nav_link(path: 'dashboard#issues', html_options: { class: "user-counter" }) do
30
              = link_to assigned_issues_dashboard_path, title: 'Issues', class: 'dashboard-shortcuts-issues', aria: { label: "Issues" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
31
                = sprite_icon('issues', size: 16)
32
                - issues_count = assigned_issuables_count(:issues)
33
34
                %span.badge.issues-count{ class: ('hidden' if issues_count.zero?) }
                  = number_with_delimiter(issues_count)
35
            = nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter" }) do
36
              = 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
37
                = sprite_icon('git-merge', size: 16)
38
                - merge_requests_count = assigned_issuables_count(:merge_requests)
39
40
                %span.badge.merge-requests-count{ class: ('hidden' if merge_requests_count.zero?) }
                  = number_with_delimiter(merge_requests_count)
41
            = nav_link(controller: 'dashboard/todos', html_options: { class: "user-counter" }) do
42
              = link_to dashboard_todos_path, title: 'Todos', aria: { label: "Todos" }, class: 'shortcuts-todos', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
43
                = sprite_icon('todo-done', size: 16)
44
                %span.badge.todos-count{ class: ('hidden' if todos_pending_count.zero?) }
45
                  = todos_count_format(todos_pending_count)
Phil Hughes's avatar
Phil Hughes committed
46
            %li.header-user.dropdown
47
              = link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do
48
                = image_tag avatar_icon(current_user, 23), width: 23, height: 23, class: "header-user-avatar qa-user-avatar"
49
                = sprite_icon('angle-down', css_class: 'caret-down')
Phil Hughes's avatar
Phil Hughes committed
50
51
              .dropdown-menu-nav.dropdown-menu-align-right
                %ul
52
53
54
55
56
                  %li.current-user
                    .user-name.bold
                      = current_user.name
                    @#{current_user.username}
                  %li.divider
Phil Hughes's avatar
Phil Hughes committed
57
                  %li
58
                    = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username }
59
                  %li
60
                    = link_to "Settings", profile_path
61
62
63
                  - if current_user
                    %li
                      = link_to "Help", help_path
Phil Hughes's avatar
Phil Hughes committed
64
65
                  %li.divider
                  %li
66
                    = link_to "Sign out", destroy_user_session_path, class: "sign-out-link"
67
68
69
70
            - if session[:impersonator_id]
              %li.impersonation
                = link_to admin_impersonation_path, class: 'impersonation-btn', method: :delete, title: "Stop impersonation", aria: { label: 'Stop impersonation' }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
                  = icon('user-secret')
71
          - else
72
73
            %li
              %div
74
                = link_to "Sign in", omniauth_authorize_path(:user, :cas3), method: :post, class: 'btn btn-sign-in', "data-no-turbolink" => "true"
75

76
      %button.navbar-toggle.hidden-sm.hidden-md.hidden-lg{ type: 'button' }
77
        %span.sr-only Toggle navigation
78
79
        = sprite_icon('more', size: 12, css_class: 'more-icon js-navbar-toggle-right')
        = sprite_icon('close', size: 12, css_class: 'close-icon js-navbar-toggle-left')