gitlabhq/app/views/protected_branches/index.html.haml

52 lines
1.8 KiB
Plaintext
Raw Normal View History

= render "repositories/branches_head"
2012-04-10 07:51:08 +02:00
.alert
%p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}.
%p This ability allows:
2012-02-15 22:51:04 +01:00
%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"}
- if can? current_user, :admin_project, @project
= form_for [@project, @protected_branch] do |f|
-if @protected_branch.errors.any?
.alert-message.block-message.error
%ul
- @protected_branch.errors.full_messages.each do |msg|
%li= msg
.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"})
 
= f.submit 'Protect', class: "primary btn"
- unless @branches.empty?
2012-09-03 20:53:16 +02:00
%table
%thead
%tr
%th Name
%th Last commit
2012-02-15 22:51:04 +01:00
%th
%tbody
- @branches.each do |branch|
%tr
%td
2012-09-26 05:33:42 +02:00
= link_to project_commits_path(@project, branch.name) do
%strong= branch.name
2013-01-04 20:45:30 +01:00
- if @project.root_ref?(branch.name)
%span.label default
%td
2012-12-03 12:22:28 +01:00
- 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)
2012-02-15 22:51:04 +01:00
%td
- if can? current_user, :admin_project, @project
= link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "danger btn small"