2017-09-10 17:25:29 +05:30
|
|
|
%li.header-new.dropdown
|
2018-11-18 11:00:15 +05:30
|
|
|
= 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', display: 'static' } do
|
2018-03-17 18:26:18 +05:30
|
|
|
= sprite_icon('plus-square', size: 16)
|
|
|
|
= sprite_icon('angle-down', css_class: 'caret-down')
|
2018-11-08 19:23:39 +05:30
|
|
|
.dropdown-menu.dropdown-menu-right
|
2017-09-10 17:25:29 +05:30
|
|
|
%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
|
2018-11-18 11:00:15 +05:30
|
|
|
%li.dropdown-bold-header
|
|
|
|
= _('This group')
|
2017-09-10 17:25:29 +05:30
|
|
|
- if create_group_project
|
|
|
|
%li.header-new-group-project
|
2018-11-18 11:00:15 +05:30
|
|
|
= link_to _('New project'), new_project_path(namespace_id: @group.id)
|
2017-09-10 17:25:29 +05:30
|
|
|
- if create_group_subgroup
|
|
|
|
%li
|
2018-11-18 11:00:15 +05:30
|
|
|
= link_to _('New subgroup'), new_group_path(parent_id: @group.id)
|
2017-09-10 17:25:29 +05:30
|
|
|
%li.divider
|
|
|
|
%li.dropdown-bold-header GitLab
|
|
|
|
|
|
|
|
- if @project&.persisted?
|
2018-05-09 12:01:36 +05:30
|
|
|
- create_project_issue = show_new_issue_link?(@project)
|
|
|
|
- merge_project = merge_request_source_project_for_project(@project)
|
2017-09-10 17:25:29 +05:30
|
|
|
- create_project_snippet = can?(current_user, :create_project_snippet, @project)
|
|
|
|
- if create_project_issue || merge_project || create_project_snippet
|
2018-11-18 11:00:15 +05:30
|
|
|
%li.dropdown-bold-header
|
|
|
|
= _('This project')
|
2017-09-10 17:25:29 +05:30
|
|
|
- if create_project_issue
|
|
|
|
%li
|
2018-11-18 11:00:15 +05:30
|
|
|
= link_to _('New issue'), new_project_issue_path(@project)
|
2017-09-10 17:25:29 +05:30
|
|
|
- if merge_project
|
|
|
|
%li
|
2018-11-18 11:00:15 +05:30
|
|
|
= link_to _('New merge request'), project_new_merge_request_path(merge_project)
|
2017-09-10 17:25:29 +05:30
|
|
|
- if create_project_snippet
|
|
|
|
%li.header-new-project-snippet
|
2018-11-18 11:00:15 +05:30
|
|
|
= link_to _('New snippet'), new_project_snippet_path(@project)
|
2017-09-10 17:25:29 +05:30
|
|
|
%li.divider
|
|
|
|
%li.dropdown-bold-header GitLab
|
|
|
|
- if current_user.can_create_project?
|
|
|
|
%li
|
2018-11-18 11:00:15 +05:30
|
|
|
= link_to _('New project'), new_project_path, class: 'qa-global-new-project-link'
|
2017-09-10 17:25:29 +05:30
|
|
|
- if current_user.can_create_group?
|
|
|
|
%li
|
2018-11-18 11:00:15 +05:30
|
|
|
= link_to _('New group'), new_group_path
|
2017-09-10 17:25:29 +05:30
|
|
|
%li
|
2018-11-18 11:00:15 +05:30
|
|
|
= link_to _('New snippet'), new_snippet_path
|