2016-04-26 14:50:31 +00:00
%h5.prepend-top-0
Already Protected (#{@branches.size})
- if @branches.empty?
%p.profile-settings-message.text-center
No branches are protected, protect a branch with the form above.
- else
- can_admin_project = can?(current_user, :admin_project, @project)
.table-responsive
2015-10-19 09:19:45 +00:00
%table.table.protected-branches-list
2016-04-26 14:50:31 +00:00
%colgroup
%col{ width: "30%" }
%col{ width: "30%" }
%col{ width: "25%" }
- if can_admin_project
%col
2015-10-19 09:19:45 +00:00
%thead
2016-04-26 14:50:31 +00:00
%tr
2015-10-19 09:19:45 +00:00
%th Branch
%th Last commit
2016-04-26 14:50:31 +00:00
%th Developers can push
- if can_admin_project
%th
2015-10-19 09:19:45 +00:00
%tbody
- @branches.each do |branch|
- @url = namespace_project_protected_branch_path(@project.namespace, @project, branch)
%tr
2014-12-26 14:36:35 +00:00
%td
2016-04-26 14:50:31 +00:00
= link_to(branch.name, namespace_project_commits_path(@project.namespace, @project, branch.name))
- if @project.root_ref?(branch.name)
%span.label.label-info.prepend-left-5 default
%td
- if commit = branch.commit
= link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit_short_id')
#{time_ago_with_tooltip(commit.committed_date)}
- else
(branch was removed from repository)
%td
= check_box_tag("developers_can_push", branch.id, branch.developers_can_push, data: { url: @url })
- if can_admin_project
2015-10-19 09:19:45 +00:00
%td
2016-04-26 14:50:31 +00:00
= link_to 'Unprotect', [@project.namespace.becomes(Namespace), @project, branch], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-warning btn-sm"