_default.html.haml 3.57 KB
Newer Older
Phil Hughes's avatar
Phil Hughes committed
1
%header.navbar.navbar-fixed-top.navbar-gitlab{ class: nav_header_class }
2
  %a{ href: "#content-body", tabindex: "1", class: "sr-only gl-accessibility" } Skip to content
3
  %div{ class: "container-fluid" }
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
4
    .header-content
Phil Hughes's avatar
Phil Hughes committed
5
      %button.side-nav-toggle{ type: 'button', "aria-label" => "Toggle global navigation" }
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
6 7
        %span.sr-only Toggle navigation
        = icon('bars')
Annabel Dunstone's avatar
Annabel Dunstone committed
8 9
      %button.navbar-toggle{type: 'button'}
        %span.sr-only Toggle navigation
10
        = icon('ellipsis-v')
11

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
12
      .navbar-collapse.collapse
13
        %ul.nav.navbar-nav
14
          %li.hidden-sm.hidden-xs
15
            = render 'layouts/search' unless current_controller?(:search)
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
16
          %li.visible-sm.visible-xs
Phil Hughes's avatar
Phil Hughes committed
17
            = link_to search_path, title: 'Search', aria: { label: "Search" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
18
              = icon('search')
19 20 21
          - if current_user
            - if session[:impersonator_id]
              %li.impersonation
Phil Hughes's avatar
Phil Hughes committed
22
                = link_to admin_impersonation_path, method: :delete, title: "Stop Impersonation", aria: { label: 'Stop Impersonation' }, data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
23 24 25
                  = icon('user-secret fw')
            - if current_user.is_admin?
              %li
Phil Hughes's avatar
Phil Hughes committed
26
                = link_to admin_root_path, title: 'Admin Area', aria: { label: "Admin Area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
27
                  = icon('wrench fw')
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
28
            %li
Phil Hughes's avatar
Phil Hughes committed
29
              = link_to dashboard_todos_path, title: 'Todos', aria: { label: "Todos" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
Jacob Schatz's avatar
Jacob Schatz committed
30
                = icon('bell fw')
31
                %span.badge.todos-pending-count{ class: ("hidden" if todos_pending_count == 0) }
32
                  = todos_pending_count
33 34 35 36 37
            - if Gitlab::Sherlock.enabled?
              %li
                = link_to sherlock_transactions_path, title: 'Sherlock Transactions',
                  data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
                  = icon('tachometer fw')
Phil Hughes's avatar
Phil Hughes committed
38 39 40
            %li.header-user.dropdown
              = link_to current_user, class: "header-user-dropdown-toggle", data: { toggle: "dropdown" } do
                = image_tag avatar_icon(current_user, 26), width: 26, height: 26, class: "header-user-avatar"
41
                = icon('caret-down')
Phil Hughes's avatar
Phil Hughes committed
42 43 44
              .dropdown-menu-nav.dropdown-menu-align-right
                %ul
                  %li
Phil Hughes's avatar
Phil Hughes committed
45
                    = link_to "Profile", current_user, class: 'profile-link', aria: { label: "Profile" }, data: { user: current_user.username }
46
                  %li
Phil Hughes's avatar
Phil Hughes committed
47
                    = link_to "Profile Settings", profile_path, aria: { label: "Profile Settings" }
48 49
                  %li
                    = link_to "Help", help_path, aria: { label: "Help" }
Phil Hughes's avatar
Phil Hughes committed
50 51
                  %li.divider
                  %li
Phil Hughes's avatar
Phil Hughes committed
52
                    = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link", aria: { label: "Sign out" }
53
          - else
54 55 56
            %li
              %div
                = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in btn-success'
57

58

59 60
      %h1.title= title

61
      .header-logo
62
        = link_to root_path, class: 'home', title: 'Dashboard', id: 'logo' do
63 64
          = brand_header_logo

65 66
      = yield :header_content

67
= render 'shared/outdated_browser'
68

69
- if @project && !@project.empty_repo?
70 71 72
  - if ref = @ref || @project.repository.root_ref
    :javascript
      var findFileURL = "#{namespace_project_find_file_path(@project.namespace, @project, ref)}";