summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-10-12 11:03:55 +0000
committerRobert Speicher <robert@gitlab.com>2016-10-12 11:03:55 +0000
commitc004bb3e74b6a60a4b6ede93d0ea8a898e56c41b (patch)
tree428673d34c8c0e1993254167a3cd32f4b15cfc64 /app
parentc0c45c72a8aa0d6c04b140508f928776b0a690ae (diff)
parentf0150ef4d9ac869be21079d21c856a1ede72a3bf (diff)
downloadgitlab-ce-c004bb3e74b6a60a4b6ede93d0ea8a898e56c41b.tar.gz
Merge branch 'add-disabled-delete-button' into 'master'
Add disabled delete button to protected branches ## What does this MR do? Add's a disabled CSS style for the delete button on protected branches instead of hiding the button ## What are the relevant issue numbers? Closes #22358 See merge request !6439
Diffstat (limited to 'app')
-rw-r--r--app/views/projects/branches/_branch.html.haml4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
index 5217b8bf028..4480b2f22c3 100644
--- a/app/views/projects/branches/_branch.html.haml
+++ b/app/views/projects/branches/_branch.html.haml
@@ -30,8 +30,8 @@
= render 'projects/buttons/download', project: @project, ref: branch.name
- - if can_remove_branch?(@project, branch.name)
- = link_to namespace_project_branch_path(@project.namespace, @project, branch.name), class: 'btn btn-remove remove-row has-tooltip', title: "Delete branch", method: :delete, data: { confirm: "Deleting the '#{branch.name}' branch cannot be undone. Are you sure?", container: 'body' }, remote: true do
+ - if can?(current_user, :push_code, @project)
+ = link_to namespace_project_branch_path(@project.namespace, @project, branch.name), class: "btn btn-remove remove-row has-tooltip #{can_remove_branch?(@project, branch.name) ? '' : 'disabled'}", title: "Delete branch", method: :delete, data: { confirm: "Deleting the '#{branch.name}' branch cannot be undone. Are you sure?", container: 'body' }, remote: true do
= icon("trash-o")
- if branch.name != @repository.root_ref