summaryrefslogtreecommitdiff
path: root/app/views/layouts/header/_default.html.haml
blob: ad30a367fc5975ff7c941f15f25707369ff314c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
%header.navbar.navbar-fixed-top.navbar-gitlab.header-collapsed{ class: nav_header_class }
  %div{ class: fluid_layout ? "container-fluid" : "container-fluid" }
    .header-content
      %button.side-nav-toggle{type: 'button'}
        %span.sr-only Toggle navigation
        = icon('bars')
      %button.navbar-toggle{type: 'button'}
        %span.sr-only Toggle navigation
        = icon('angle-left')

      .navbar-collapse.collapse
        %ul.nav.navbar-nav
          %li.hidden-sm.hidden-xs
            = render 'layouts/search' unless current_controller?(:search)
          %li.visible-sm.visible-xs
            = link_to search_path, title: 'Search', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
              = icon('search')
          - if current_user
            - if session[:impersonator_id]
              %li.impersonation
                = link_to admin_impersonation_path, method: :delete, title: 'Stop Impersonation', data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do
                  = icon('user-secret fw')
            - if current_user.is_admin?
              %li
                = link_to admin_root_path, title: 'Admin Area', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
                  = icon('wrench fw')
            %li
              = link_to dashboard_todos_path, title: 'Todos', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
                = icon('bell fw')
                - unless todos_pending_count == 0
                  %span.badge.todos-pending-count
                    = todos_pending_count
            - if current_user.can_create_project?
              %li
                = link_to new_project_path, title: 'New project', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
                  = icon('plus fw')
            - if Gitlab::Sherlock.enabled?
              %li
                = link_to sherlock_transactions_path, title: 'Sherlock Transactions',
                  data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
                  = icon('tachometer fw')
            %li
              = link_to destroy_user_session_path, class: 'logout', method: :delete, title: 'Sign out', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
                = icon('sign-out')
          - else
            %li
              %div
                = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in btn-success'


      %h1.title= title

      .header-logo
        #logo
          = brand_header_logo

      = yield :header_content

= render 'shared/outdated_browser'

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