_default.html.haml 4.23 KB
Newer Older
1
%header.navbar.navbar-gitlab.navbar-gitlab-new
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
9
10
      .title-container
        %h1.title
          = link_to root_path, title: 'Dashboard', id: 'logo' do
            = brand_header_logo
            %span.logo-text.hidden-xs
              = render 'shared/logo_type.svg'
11

12
13
14
15
        - if current_user
          = render "layouts/nav/dashboard"
        - else
          = render "layouts/nav/explore"
16

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

74
      %button.navbar-toggle.hidden-sm.hidden-md.hidden-lg{ type: 'button' }
75
        %span.sr-only Toggle navigation
76
77
        = icon('ellipsis-v', class: 'js-navbar-toggle-right')
        = icon('times', class: 'js-navbar-toggle-left')
78

79
= render 'shared/outdated_browser'