diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-09 23:24:26 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-03-19 23:23:03 +0300 |
commit | 67043ec53b4c35d5a9862fe78bd3f47e412919cd (patch) | |
tree | 66f8b4e84d34eb26291ebead4268e9bc4cf20ba3 /app/views | |
parent | 212e83bab3f1f9055f1321c3e934b4f4659250bf (diff) |
Hide delete botton on edit page
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/issues/show.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show/_mr_title.html.haml | 4 | ||||
-rw-r--r-- | app/views/shared/issuable/_form.html.haml | 4 |
3 files changed, 4 insertions, 8 deletions
diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index 2f0a91267eb..6fa059cbe68 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -45,10 +45,6 @@ - if can?(current_user, :update_issue, @issue) = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "btn btn-nr btn-grouped btn-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "btn btn-nr btn-grouped btn-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' - - if current_user.admin? - = link_to namespace_project_issue_path(@project.namespace, @project, @issue), method: :delete, class: 'btn btn-grouped' do - = icon('trash-o') - Delete = link_to edit_namespace_project_issue_path(@project.namespace, @project, @issue), class: 'btn btn-nr btn-grouped issuable-edit' do = icon('pencil-square-o') Edit 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 3a7208cb3e8..fb05c21648d 100644 --- a/app/views/projects/merge_requests/show/_mr_title.html.haml +++ b/app/views/projects/merge_requests/show/_mr_title.html.haml @@ -33,7 +33,3 @@ 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' - - if current_user.admin? - = link_to namespace_project_merge_request_path(@project.namespace, @project, @merge_request), method: :delete, class: 'btn btn-grouped' do - = icon('trash-o') - Delete diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 80418e69d9c..6030abe390e 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -106,6 +106,10 @@ = 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 |