2015-09-11 14:41:01 +05:30
|
|
|
- if current_user
|
2017-08-17 22:00:37 +05:30
|
|
|
.project-action-button.dropdown.inline
|
2017-09-10 17:25:29 +05:30
|
|
|
%a.btn.dropdown-toggle.has-tooltip{ href: '#', title: _('Create new...'), 'data-toggle' => 'dropdown', 'data-container' => 'body', 'aria-label' => _('Create new...') }
|
2015-09-11 14:41:01 +05:30
|
|
|
= icon('plus')
|
2016-11-03 12:29:30 +05:30
|
|
|
= icon("caret-down")
|
2016-06-16 23:09:34 +05:30
|
|
|
%ul.dropdown-menu.dropdown-menu-align-right.project-home-dropdown
|
2016-06-02 11:05:42 +05:30
|
|
|
- can_create_issue = can?(current_user, :create_issue, @project)
|
|
|
|
- merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project))
|
2018-03-17 18:26:18 +05:30
|
|
|
- can_create_project_snippet = can?(current_user, :create_project_snippet, @project)
|
|
|
|
|
|
|
|
- if can_create_issue || merge_project || can_create_project_snippet
|
|
|
|
%li.dropdown-header= _('This project')
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
- if can_create_issue
|
2018-03-17 18:26:18 +05:30
|
|
|
%li= link_to _('New issue'), new_project_issue_path(@project)
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2016-01-14 18:37:52 +05:30
|
|
|
- if merge_project
|
2018-03-17 18:26:18 +05:30
|
|
|
%li= link_to _('New merge request'), project_new_merge_request_path(merge_project)
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
- if can_create_project_snippet
|
|
|
|
%li= link_to _('New snippet'), new_project_snippet_path(@project)
|
2016-01-14 18:37:52 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
- if can?(current_user, :push_code, @project)
|
|
|
|
%li.dropdown-header= _('This repository')
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
- if can?(current_user, :push_code, @project)
|
2018-03-17 18:26:18 +05:30
|
|
|
%li= link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master')
|
|
|
|
- unless @project.empty_repo?
|
|
|
|
%li= link_to _('New branch'), new_project_branch_path(@project)
|
|
|
|
%li= link_to _('New tag'), new_project_tag_path(@project)
|
2016-01-14 18:37:52 +05:30
|
|
|
- elsif current_user && current_user.already_forked?(@project)
|
2018-03-17 18:26:18 +05:30
|
|
|
%li= link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master')
|
2016-01-14 18:37:52 +05:30
|
|
|
- elsif can?(current_user, :fork_project, @project)
|
2018-03-17 18:26:18 +05:30
|
|
|
- continue_params = { to: project_new_blob_path(@project, @project.default_branch || 'master'),
|
|
|
|
notice: edit_in_new_fork_notice,
|
|
|
|
notice_now: edit_in_new_fork_notice_now }
|
|
|
|
- fork_path = project_forks_path(@project, namespace_key: current_user.namespace.id, continue: continue_params)
|
|
|
|
%li= link_to _('New file'), fork_path, method: :post
|