diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-14 21:46:44 +0100 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-19 21:24:05 +0100 |
commit | 7342a4566cc2eef0e434f3aea0eac48674baaaf1 (patch) | |
tree | 2c01812a3736544d759dd4cdd59cd0a6ae1bb408 /app/views/shared | |
parent | 67043ec53b4c35d5a9862fe78bd3f47e412919cd (diff) | |
download | gitlab-ce-7342a4566cc2eef0e434f3aea0eac48674baaaf1.tar.gz |
Dry destroy action on issuables
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/issuable/_form.html.haml | 16 |
1 files changed, 9 insertions, 7 deletions
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 |