2013-01-08 06:14:05 +01:00
|
|
|
= render "commits/head"
|
|
|
|
.row
|
|
|
|
.span3
|
|
|
|
= render "repositories/filter"
|
|
|
|
.span9
|
|
|
|
.alert
|
|
|
|
%p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}.
|
|
|
|
%p This ability allows:
|
|
|
|
%ul
|
|
|
|
%li keep stable branches secured
|
|
|
|
%li forced code review before merge to protected branches
|
|
|
|
%p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"}
|
2012-02-15 21:02:33 +01:00
|
|
|
|
2013-01-08 06:14:05 +01:00
|
|
|
- if can? current_user, :admin_project, @project
|
|
|
|
= form_for [@project, @protected_branch] do |f|
|
|
|
|
-if @protected_branch.errors.any?
|
2013-01-30 15:53:18 +01:00
|
|
|
.alert.alert-error
|
2013-01-08 06:14:05 +01:00
|
|
|
%ul
|
|
|
|
- @protected_branch.errors.full_messages.each do |msg|
|
|
|
|
%li= msg
|
2012-02-15 21:02:33 +01:00
|
|
|
|
2013-01-08 06:14:05 +01:00
|
|
|
.entry.clearfix
|
|
|
|
= f.label :name, "Branch"
|
|
|
|
.span3
|
|
|
|
= f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "chosen span3"})
|
|
|
|
|
2013-01-29 21:18:19 +01:00
|
|
|
= f.submit 'Protect', class: "btn-primary btn"
|
2012-05-17 23:23:18 +02:00
|
|
|
|
2013-01-08 06:14:05 +01:00
|
|
|
- unless @branches.empty?
|
|
|
|
%table
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th Name
|
|
|
|
%th Last commit
|
|
|
|
%th
|
|
|
|
%tbody
|
|
|
|
- @branches.each do |branch|
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
= link_to project_commits_path(@project, branch.name) do
|
|
|
|
%strong= branch.name
|
|
|
|
- if @project.root_ref?(branch.name)
|
|
|
|
%span.label default
|
|
|
|
%td
|
|
|
|
- if branch.commit
|
|
|
|
= link_to project_commit_path(@project, branch.commit.id) do
|
|
|
|
= truncate branch.commit.id.to_s, length: 10
|
|
|
|
= time_ago_in_words(branch.commit.committed_date)
|
|
|
|
ago
|
|
|
|
- else
|
|
|
|
(branch was removed from repository)
|
|
|
|
%td
|
|
|
|
- if can? current_user, :admin_project, @project
|
2013-01-29 21:29:21 +01:00
|
|
|
= link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small"
|