2015-07-13 12:42:07 -04:00
|
|
|
- if current_user
|
2016-12-16 10:46:24 -05:00
|
|
|
.project-action-button.dropdown.inline
|
2016-12-26 05:47:16 -05:00
|
|
|
%a.btn.dropdown-toggle{ href: '#', "data-toggle" => "dropdown" }
|
2015-07-31 07:56:15 -04:00
|
|
|
= icon('plus')
|
2016-10-04 21:18:18 -04:00
|
|
|
= icon("caret-down")
|
2016-05-19 11:11:54 -04:00
|
|
|
%ul.dropdown-menu.dropdown-menu-align-right.project-home-dropdown
|
2016-03-31 19:02:50 -04:00
|
|
|
- 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))
|
|
|
|
- can_create_snippet = can?(current_user, :create_snippet, @project)
|
|
|
|
|
|
|
|
- if can_create_issue
|
2015-07-13 12:42:07 -04:00
|
|
|
%li
|
2016-08-01 21:23:12 -04:00
|
|
|
= link_to new_namespace_project_issue_path(@project.namespace, @project) do
|
2015-07-31 07:56:15 -04:00
|
|
|
= icon('exclamation-circle fw')
|
2015-07-13 12:42:07 -04:00
|
|
|
New issue
|
2016-03-31 19:02:50 -04:00
|
|
|
|
2015-12-23 10:20:07 -05:00
|
|
|
- if merge_project
|
2015-07-13 12:42:07 -04:00
|
|
|
%li
|
2015-12-23 10:20:07 -05:00
|
|
|
= link_to new_namespace_project_merge_request_path(merge_project.namespace, merge_project) do
|
2015-07-31 07:56:15 -04:00
|
|
|
= icon('tasks fw')
|
2015-12-25 11:30:48 -05:00
|
|
|
New merge request
|
2016-03-31 19:02:50 -04:00
|
|
|
|
|
|
|
- if can_create_snippet
|
2015-07-13 12:42:07 -04:00
|
|
|
%li
|
2015-07-31 07:56:15 -04:00
|
|
|
= link_to new_namespace_project_snippet_path(@project.namespace, @project) do
|
|
|
|
= icon('file-text-o fw')
|
2015-07-13 12:42:07 -04:00
|
|
|
New snippet
|
2015-12-18 04:03:34 -05:00
|
|
|
|
2016-03-31 19:02:50 -04:00
|
|
|
- if can_create_issue || merge_project || can_create_snippet
|
2015-07-13 12:42:07 -04:00
|
|
|
%li.divider
|
2016-03-31 19:02:50 -04:00
|
|
|
|
|
|
|
- if can?(current_user, :push_code, @project)
|
2015-11-02 09:36:04 -05:00
|
|
|
%li
|
2015-12-18 04:03:34 -05:00
|
|
|
= link_to namespace_project_new_blob_path(@project.namespace, @project, @project.default_branch || 'master') do
|
2015-11-02 09:36:04 -05:00
|
|
|
= icon('file fw')
|
|
|
|
New file
|
2015-07-13 12:42:07 -04:00
|
|
|
%li
|
|
|
|
= link_to new_namespace_project_branch_path(@project.namespace, @project) do
|
2015-07-31 07:56:15 -04:00
|
|
|
= icon('code-fork fw')
|
|
|
|
New branch
|
2015-07-13 12:42:07 -04:00
|
|
|
%li
|
|
|
|
= link_to new_namespace_project_tag_path(@project.namespace, @project) do
|
2015-07-31 07:56:15 -04:00
|
|
|
= icon('tags fw')
|
|
|
|
New tag
|
2015-12-18 04:03:34 -05:00
|
|
|
- elsif current_user && current_user.already_forked?(@project)
|
|
|
|
%li
|
|
|
|
= link_to namespace_project_new_blob_path(@project.namespace, @project, @project.default_branch || 'master') do
|
|
|
|
= icon('file fw')
|
|
|
|
New file
|
|
|
|
- elsif can?(current_user, :fork_project, @project)
|
|
|
|
%li
|
|
|
|
- continue_params = { to: namespace_project_new_blob_path(@project.namespace, @project, @project.default_branch || 'master'),
|
|
|
|
notice: edit_in_new_fork_notice,
|
|
|
|
notice_now: edit_in_new_fork_notice_now }
|
2016-01-11 14:44:31 -05:00
|
|
|
- fork_path = namespace_project_forks_path(@project.namespace, @project, namespace_key: current_user.namespace.id,
|
2015-12-18 04:03:34 -05:00
|
|
|
continue: continue_params)
|
|
|
|
= link_to fork_path, method: :post do
|
|
|
|
= icon('file fw')
|
|
|
|
New file
|