debian-mirror-gitlab/app/views/layouts/header/_default.html.haml

85 lines
4.8 KiB
Text
Raw Normal View History

2018-03-17 18:26:18 +05:30
%header.navbar.navbar-gitlab.qa-navbar
2017-08-17 22:00:37 +05:30
%a.sr-only.gl-accessibility{ href: "#content-body", tabindex: "1" } Skip to content
.container-fluid
2015-09-11 14:41:01 +05:30
.header-content
2018-03-17 18:26:18 +05:30
.title-container
%h1.title
= link_to root_path, title: 'Dashboard', id: 'logo' do
= brand_header_logo
- logo_text = brand_header_logo_type
- if logo_text.present?
%span.logo-text.hidden-xs
= logo_text
2017-08-17 22:00:37 +05:30
2018-03-17 18:26:18 +05:30
- if current_user
= render "layouts/nav/dashboard"
- else
= render "layouts/nav/explore"
2015-09-11 14:41:01 +05:30
.navbar-collapse.collapse
2016-06-02 11:05:42 +05:30
%ul.nav.navbar-nav
2018-03-17 18:26:18 +05:30
- if current_user
= render 'layouts/header/new_dropdown'
2018-03-27 19:54:05 +05:30
- if header_link?(:search)
%li.hidden-sm.hidden-xs
= render 'layouts/search' unless current_controller?(:search)
%li.visible-sm-inline-block.visible-xs-inline-block
= link_to search_path, title: 'Search', aria: { label: "Search" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('search', size: 16)
- if header_link?(:issues)
2018-03-17 18:26:18 +05:30
= nav_link(path: 'dashboard#issues', html_options: { class: "user-counter" }) do
= link_to assigned_issues_dashboard_path, title: 'Issues', class: 'dashboard-shortcuts-issues', aria: { label: "Issues" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('issues', size: 16)
2017-08-17 22:00:37 +05:30
- issues_count = assigned_issuables_count(:issues)
%span.badge.issues-count{ class: ('hidden' if issues_count.zero?) }
= number_with_delimiter(issues_count)
2018-03-27 19:54:05 +05:30
- if header_link?(:merge_requests)
2018-03-17 18:26:18 +05:30
= nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter" }) do
= 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
= sprite_icon('git-merge', size: 16)
2017-08-17 22:00:37 +05:30
- merge_requests_count = assigned_issuables_count(:merge_requests)
%span.badge.merge-requests-count{ class: ('hidden' if merge_requests_count.zero?) }
= number_with_delimiter(merge_requests_count)
2018-03-27 19:54:05 +05:30
- if header_link?(:todos)
2018-03-17 18:26:18 +05:30
= nav_link(controller: 'dashboard/todos', html_options: { class: "user-counter" }) do
2017-08-17 22:00:37 +05:30
= link_to dashboard_todos_path, title: 'Todos', aria: { label: "Todos" }, class: 'shortcuts-todos', data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
2018-03-17 18:26:18 +05:30
= sprite_icon('todo-done', size: 16)
2017-08-17 22:00:37 +05:30
%span.badge.todos-count{ class: ('hidden' if todos_pending_count.zero?) }
= todos_count_format(todos_pending_count)
2018-03-27 19:54:05 +05:30
- if header_link?(:user_dropdown)
2016-08-24 12:49:21 +05:30
%li.header-user.dropdown
2018-03-17 18:26:18 +05:30
= link_to current_user, class: user_dropdown_class, data: { toggle: "dropdown" } do
2018-03-27 19:54:05 +05:30
= image_tag avatar_icon_for_user(current_user, 23), width: 23, height: 23, class: "header-user-avatar qa-user-avatar"
2018-03-17 18:26:18 +05:30
= sprite_icon('angle-down', css_class: 'caret-down')
2016-08-24 12:49:21 +05:30
.dropdown-menu-nav.dropdown-menu-align-right
%ul
2017-08-17 22:00:37 +05:30
%li.current-user
.user-name.bold
= current_user.name
@#{current_user.username}
%li.divider
2016-08-24 12:49:21 +05:30
%li
2017-09-10 17:25:29 +05:30
= link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username }
%li
= link_to "Settings", profile_path
2018-03-17 18:26:18 +05:30
- if current_user
%li
= link_to "Help", help_path
2016-08-24 12:49:21 +05:30
%li.divider
%li
2018-03-17 18:26:18 +05:30
= link_to "Sign out", destroy_user_session_path, class: "sign-out-link"
2018-03-27 19:54:05 +05:30
- if header_link?(:admin_impersonation)
%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')
- if header_link?(:sign_in)
2015-11-26 14:37:03 +05:30
%li
2016-06-02 11:05:42 +05:30
%div
2018-03-17 18:26:18 +05:30
= link_to "Sign in / Register", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in'
2016-06-02 11:05:42 +05:30
2018-03-17 18:26:18 +05:30
%button.navbar-toggle.hidden-sm.hidden-md.hidden-lg{ type: 'button' }
2017-08-17 22:00:37 +05:30
%span.sr-only Toggle navigation
2018-03-17 18:26:18 +05:30
= 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')