diff options
author | Robert Speicher <rspeicher@gmail.com> | 2018-01-16 14:52:37 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2018-01-16 14:52:37 -0600 |
commit | a13eae6afaaac070da61b72392f1b830fad33546 (patch) | |
tree | 761800b9fee0bf6940c7b292b06ed16ae73db597 /app/views/projects/buttons/_dropdown.html.haml | |
parent | f17d7a4beef61d0156865f1a9070fb53c8f05c99 (diff) | |
download | gitlab-ce-a13eae6afaaac070da61b72392f1b830fad33546.tar.gz |
Further simplify app/views/projects/buttons/_dropdown.html.hamlrs-buttons-partial
Diffstat (limited to 'app/views/projects/buttons/_dropdown.html.haml')
-rw-r--r-- | app/views/projects/buttons/_dropdown.html.haml | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/app/views/projects/buttons/_dropdown.html.haml b/app/views/projects/buttons/_dropdown.html.haml index a94d9c14722..dab94d10bb1 100644 --- a/app/views/projects/buttons/_dropdown.html.haml +++ b/app/views/projects/buttons/_dropdown.html.haml @@ -9,34 +9,27 @@ - can_create_snippet = can?(current_user, :create_snippet, @project) - if can_create_issue - %li - = link_to _('New issue'), new_project_issue_path(@project) + %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) + %li= link_to _('New merge request'), project_new_merge_request_path(merge_project) + - if can_create_snippet - %li - = link_to _('New snippet'), new_project_snippet_path(@project) + %li= link_to _('New snippet'), new_project_snippet_path(@project) - if can_create_issue || merge_project || can_create_snippet %li.divider - if can?(current_user, :push_code, @project) - %li - = link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master') + %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) + %li= link_to _('New branch'), new_project_branch_path(@project) + %li= link_to _('New tag'), new_project_tag_path(@project) - elsif current_user && current_user.already_forked?(@project) - %li - = link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master') + %li= link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master') - elsif can?(current_user, :fork_project, @project) - %li - - 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) - = link_to _('New file'), fork_path, method: :post + - 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 |