summaryrefslogtreecommitdiff
path: root/app/views/layouts/header/_new_dropdown.haml
blob: 6f53f5ac1ae20766bf799f9c385d64012de7312a (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
%li.header-new.dropdown
  = link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip qa-new-menu-toggle", title: "New...", ref: 'tooltip', aria: { label: "New..." }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body' } do
    = sprite_icon('plus-square', size: 16)
    = sprite_icon('angle-down', css_class: 'caret-down')
  .dropdown-menu-nav.dropdown-menu-align-right
    %ul
      - if @group&.persisted?
        - create_group_project = can?(current_user, :create_projects, @group)
        - create_group_subgroup = can?(current_user, :create_subgroup, @group)
        - if create_group_project || create_group_subgroup
          %li.dropdown-bold-header This group
          - if create_group_project
            %li.header-new-group-project
              = link_to 'New project', new_project_path(namespace_id: @group.id)
          - if create_group_subgroup
            %li
              = link_to 'New subgroup', new_group_path(parent_id: @group.id)
          %li.divider
          %li.dropdown-bold-header GitLab

      - if @project&.persisted?
        - create_project_issue = show_new_issue_link?(@project)
        - merge_project = merge_request_source_project_for_project(@project)
        - create_project_snippet = can?(current_user, :create_project_snippet, @project)
        - if create_project_issue || merge_project || create_project_snippet
          %li.dropdown-bold-header This project
          - if create_project_issue
            %li
              = link_to 'New issue', new_project_issue_path(@project)
          - if merge_project
            %li
              = link_to 'New merge request', project_new_merge_request_path(merge_project)
          - if create_project_snippet
            %li.header-new-project-snippet
              = link_to 'New snippet', new_project_snippet_path(@project)
          %li.divider
          %li.dropdown-bold-header GitLab
      - if current_user.can_create_project?
        %li
          = link_to 'New project', new_project_path
      - if current_user.can_create_group?
        %li
          = link_to 'New group', new_group_path
      %li
        = link_to 'New snippet', new_snippet_path