diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-14 23:46:44 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-19 23:24:05 +0300 |
commit | 7342a4566cc2eef0e434f3aea0eac48674baaaf1 (patch) | |
tree | 2c01812a3736544d759dd4cdd59cd0a6ae1bb408 /app/views | |
parent | 67043ec53b4c35d5a9862fe78bd3f47e412919cd (diff) |
Dry destroy action on issuables
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/merge_requests/show/_mr_title.html.haml | 2 | ||||
-rw-r--r-- | app/views/shared/issuable/_form.html.haml | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/app/views/projects/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml index fb05c21648d..806e4e83608 100644 --- a/app/views/projects/merge_requests/show/_mr_title.html.haml +++ b/app/views/projects/merge_requests/show/_mr_title.html.haml @@ -29,7 +29,7 @@ - if @merge_request.open? = link_to 'Close', merge_request_path(@merge_request, merge_request: { state_event: :close }), method: :put, class: 'btn btn-nr btn-grouped btn-close', title: 'Close merge request' = link_to edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'btn btn-nr btn-grouped issuable-edit', id: 'edit_merge_request' do - =icon('pencil-square-o') #%i.fa.fa-pencil-square-o + =icon('pencil-square-o') Edit - if @merge_request.closed? = link_to 'Reopen', merge_request_path(@merge_request, merge_request: {state_event: :reopen }), method: :put, class: 'btn btn-nr btn-grouped btn-reopen reopen-mr-link', title: 'Reopen merge request' diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 6030abe390e..4e1171cfb3d 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -106,10 +106,6 @@ = f.submit "Submit #{issuable.class.model_name.human.downcase}", class: 'btn btn-create' - else = f.submit 'Save changes', class: 'btn btn-save' - - if current_user.admin? || current_user.owner?(@project) - = link_to namespace_project_issue_path(@project.namespace, @project, issuable), method: :delete, class: 'btn' do - = icon('trash-o') - Delete - if !issuable.persisted? && !issuable.project.empty_repo? && (guide_url = contribution_guide_path(issuable.project)) .inline.prepend-left-10 @@ -118,7 +114,13 @@ for this project. - if issuable.new_record? - - cancel_project = issuable.source_project + = link_to namespace_project_issues_path(@project.namespace, @project), class: 'btn btn-cancel' do + Cancel - else - - cancel_project = issuable.project - = link_to 'Cancel', [cancel_project.namespace.becomes(Namespace), cancel_project, issuable], class: 'btn btn-cancel' + - if current_user.can?(:"remove_#{issuable.to_ability_name}", @project) + .pull-right + = link_to polymorphic_path([@project.namespace.becomes(Namespace), @project, issuable]), method: :delete, class: 'btn' do + = icon('trash-o') + Delete + = link_to namespace_project_issue_path(@project.namespace, @project, issuable), class: 'btn btn-cancel' do + Cancel |