2021-06-08 01:23:25 +05:30
|
|
|
- new_repo_experiment_text = content_for(:new_repo_experiment)
|
2021-04-29 21:17:54 +05:30
|
|
|
%li.header-new.dropdown{ data: { track_label: "new_dropdown", track_event: "click_dropdown", track_experiment: "new_repo" } }
|
2019-09-30 21:07:59 +05:30
|
|
|
= link_to new_project_path, class: "header-new-dropdown-toggle has-tooltip qa-new-menu-toggle", id: "js-onboarding-new-project-link", title: _("New..."), ref: 'tooltip', aria: { label: _("New...") }, data: { toggle: 'dropdown', placement: 'bottom', container: 'body', display: 'static' } do
|
2020-10-24 23:57:45 +05:30
|
|
|
= sprite_icon('plus-square')
|
2021-01-03 14:25:43 +05:30
|
|
|
= sprite_icon('chevron-down', css_class: 'caret-down')
|
2021-03-08 18:12:59 +05:30
|
|
|
.dropdown-menu.dropdown-menu-right.dropdown-extended-height
|
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)
|
2019-02-15 15:39:39 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
- 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
|
2021-06-08 01:23:25 +05:30
|
|
|
%li= link_to new_repo_experiment_text, new_project_path(namespace_id: @group.id), data: { track_experiment: 'new_repo', track_event: 'click_link_new_project_group', track_label: 'plus_menu_dropdown' }
|
2017-09-10 17:25:29 +05:30
|
|
|
- if create_group_subgroup
|
2021-06-08 01:23:25 +05:30
|
|
|
%li= link_to _('New subgroup'), new_group_path(parent_id: @group.id), data: { track_event: 'click_link_new_subgroup', track_label: 'plus_menu_dropdown' }
|
2020-07-28 23:09:34 +05:30
|
|
|
= render_if_exists 'layouts/header/create_epic_new_dropdown_item'
|
2021-03-08 18:12:59 +05:30
|
|
|
= render 'layouts/header/group_invite_members_new_dropdown_item'
|
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)
|
2020-03-13 15:44:24 +05:30
|
|
|
- create_project_snippet = can?(current_user, :create_snippet, @project)
|
2019-02-15 15:39:39 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
- 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
|
2021-06-08 01:23:25 +05:30
|
|
|
%li= link_to _('New issue'), new_project_issue_path(@project), data: { track_event: 'click_link_new_issue', track_label: 'plus_menu_dropdown' }
|
2017-09-10 17:25:29 +05:30
|
|
|
- if merge_project
|
2021-06-08 01:23:25 +05:30
|
|
|
%li= link_to _('New merge request'), project_new_merge_request_path(merge_project), data: { track_event: 'click_link_new_mr', track_label: 'plus_menu_dropdown' }
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
- if create_project_snippet
|
2021-06-08 01:23:25 +05:30
|
|
|
%li= link_to _('New snippet'), new_project_snippet_path(@project), data: { track_event: 'click_link_new_snippet_project', track_label: 'plus_menu_dropdown' }
|
2021-03-08 18:12:59 +05:30
|
|
|
= render 'layouts/header/project_invite_members_new_dropdown_item'
|
2017-09-10 17:25:29 +05:30
|
|
|
%li.divider
|
|
|
|
%li.dropdown-bold-header GitLab
|
2021-06-08 01:23:25 +05:30
|
|
|
- if current_user.can_create_project?
|
|
|
|
%li= link_to new_repo_experiment_text, new_project_path, class: 'qa-global-new-project-link', data: { track_experiment: 'new_repo', track_event: 'click_link_new_project', track_label: 'plus_menu_dropdown' }
|
2017-09-10 17:25:29 +05:30
|
|
|
- if current_user.can_create_group?
|
2021-06-08 01:23:25 +05:30
|
|
|
%li= link_to _('New group'), new_group_path, data: { track_event: 'click_link_new_group', track_label: 'plus_menu_dropdown' }
|
2020-03-13 15:44:24 +05:30
|
|
|
- if current_user.can?(:create_snippet)
|
2021-06-08 01:23:25 +05:30
|
|
|
%li= link_to _('New snippet'), new_snippet_path, data: { track_event: 'click_link_new_snippet_parent', track_label: 'plus_menu_dropdown' }, class: 'qa-global-new-snippet-link'
|