diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-05-26 12:07:09 +0200 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-06-07 11:10:24 +0200 |
commit | 0dbc5cd87b611a80c55bb46a1ca40e21a7ecf760 (patch) | |
tree | cd1e880b28e995e3ab67cd7e13648c1380d3527f /app/views/layouts | |
parent | dddc54aa0aea4088e5a233d18a62cb2435590fe9 (diff) | |
download | gitlab-ce-0dbc5cd87b611a80c55bb46a1ca40e21a7ecf760.tar.gz |
Added Dropdown + Options
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/header/_default.html.haml | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 9db98451f1d..00d143f4fb0 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -36,10 +36,48 @@ %li = link_to admin_root_path, title: 'Admin area', aria: { label: "Admin area" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('wrench fw') - - if current_user.can_create_project? - %li - = link_to new_project_path, title: 'New project', aria: { label: "New project" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do - = icon('plus fw') + %li.header-new.dropdown + = link_to new_project_path, class: "header-new-dropdown-toggle", aria: { label: "New…" } , data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do + = icon('plus fw') + = icon('caret-down') + .dropdown-menu-nav.dropdown-menu-align-right + %ul + + - if @group && (can?(current_user, :create_projects, @group) || can?(current_user, :create_subgroup, @group)) + %li + .bold This group + - if can?(current_user, :create_projects, @group) + %li + = link_to 'New project', new_project_path(namespace_id: @group.id), aria: { label: "New project" } + - if can?(current_user, :create_subgroup, @group) + %li + = link_to 'New subgroup', new_group_path(parent_id: @group.id), aria: { label: "New subgroup" } + - if @project + %li + .bold This project + %li + = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project), aria: { label: "New issue" } + - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project)) + - if merge_project + %li + = link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project), aria: { label: "New merge request" } + - if can?(current_user, :create_project_snippet, @project) + %li + = link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project), aria: { label: "New snippet" } + - if @group || @project + %li.divider + %li + .bold GitLab + - if current_user.can_create_project? + %li + = link_to 'New project', new_project_path, aria: { label: "New project" } + - if current_user.can_create_group? + %li + = link_to 'New group', new_group_path, aria: { label: "New group" } + %li + = link_to 'New snippet', new_snippet_path, aria: { label: "New snippet" } + + - if Gitlab::Sherlock.enabled? %li = link_to sherlock_transactions_path, title: 'Sherlock Transactions', |