2014-12-26 14:36:35 +00:00
- unless @branches.empty?
2014-12-29 17:30:27 +00:00
%br
%h4 Already Protected:
2014-12-26 14:36:35 +00:00
%table.table.protected-branches-list
%thead
2014-12-26 16:16:38 +00:00
%tr.no-border
%th Branch
%th Developers can push
2014-12-29 17:30:27 +00:00
%th Last commit
2014-12-26 16:16:38 +00:00
%th
2014-12-26 14:36:35 +00:00
%tbody
- @branches.each do |branch|
2015-01-24 18:02:58 +00:00
- @url = namespace_project_protected_branch_path(@project.namespace, @project, branch)
2014-12-26 14:36:35 +00:00
%tr
%td
2015-01-24 18:02:58 +00:00
= link_to namespace_project_commits_path(@project.namespace, @project, branch.name) do
2014-12-26 14:36:35 +00:00
%strong= branch.name
- if @project.root_ref?(branch.name)
%span.label.label-info default
%td
= check_box_tag "developers_can_push", branch.id, branch.developers_can_push, "data-url" => @url
2014-12-29 17:30:27 +00:00
%td
- if commit = branch.commit
2015-01-24 18:02:58 +00:00
= link_to namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit_short_id' do
2014-12-29 17:30:27 +00:00
= commit.short_id
·
#{time_ago_with_tooltip(commit.committed_date)}
- else
(branch was removed from repository)
2014-12-26 14:36:35 +00:00
%td
.pull-right
- if can? current_user, :admin_project, @project
2015-03-14 07:29:32 +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-remove btn-sm"