diff options
author | Mark Fletcher <mark@gitlab.com> | 2018-01-16 11:44:23 +0300 |
---|---|---|
committer | Mark Fletcher <mark@gitlab.com> | 2018-01-16 11:47:25 +0300 |
commit | 1704dc9720f30fa71a383b24b236893460a76226 (patch) | |
tree | aae20de53647443be2b37d903e7f86a395b5364c /app/views | |
parent | 4b99bee09602ea0cb950347187b5fdf6d39603b8 (diff) |
Refactor of buttons _dropdown partial
Remove block + interpolation to simplify the calls to link helpers
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/buttons/_dropdown.html.haml | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/app/views/projects/buttons/_dropdown.html.haml b/app/views/projects/buttons/_dropdown.html.haml index 8e8c911185a..a94d9c14722 100644 --- a/app/views/projects/buttons/_dropdown.html.haml +++ b/app/views/projects/buttons/_dropdown.html.haml @@ -10,37 +10,28 @@ - if can_create_issue %li - = link_to new_project_issue_path(@project) do - #{ _('New issue') } - + = link_to _('New issue'), new_project_issue_path(@project) - if merge_project %li - = link_to project_new_merge_request_path(merge_project) do - #{ _('New merge request') } - + = link_to _('New merge request'), project_new_merge_request_path(merge_project) - if can_create_snippet %li - = link_to new_project_snippet_path(@project) do - #{ _('New snippet') } + = 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 project_new_blob_path(@project, @project.default_branch || 'master') do - #{ _('New file') } + = link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master') - unless @project.empty_repo? %li - = link_to new_project_branch_path(@project) do - #{ _('New branch') } + = link_to _('New branch'), new_project_branch_path(@project) %li - = link_to new_project_tag_path(@project) do - #{ _('New tag') } + = link_to _('New tag'), new_project_tag_path(@project) - elsif current_user && current_user.already_forked?(@project) %li - = link_to project_new_blob_path(@project, @project.default_branch || 'master') do - #{ _('New file') } + = 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'), @@ -48,5 +39,4 @@ 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 fork_path, method: :post do - #{ _('New file') } + = link_to _('New file'), fork_path, method: :post |