diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2016-09-20 15:44:07 -0500 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2016-10-11 20:39:06 -0500 |
commit | f0150ef4d9ac869be21079d21c856a1ede72a3bf (patch) | |
tree | 786f84fe831ec99ee851f731ff165e0d313da78a /app/views/projects/branches | |
parent | 4c8ea149edff0f03390db7f287753fc6c23fb75a (diff) | |
download | gitlab-ce-f0150ef4d9ac869be21079d21c856a1ede72a3bf.tar.gz |
Add disabled delete button to protected branches
Diffstat (limited to 'app/views/projects/branches')
-rw-r--r-- | app/views/projects/branches/_branch.html.haml | 4 |
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 |