1 = render "projects/commits/head"
4 = render "projects/branches/filter"
6 .bs-callout.bs-callout-info
7 %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}.
8 %p This ability allows:
10 %li keep stable branches secured
11 %li forced code review before merge to protected branches
12 %p Read more about project permissions #{link_to "here", help_permissions_path, class: "underlined_link"}
14 - if can? current_user, :admin_project, @project
15 = form_for [@project, @protected_branch], html: { class: 'form-horizontal' } do |f|
16 -if @protected_branch.errors.any?
19 - @protected_branch.errors.full_messages.each do |msg|
23 = f.label :name, "Branch", class: 'control-label'
25 = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "select2"})
27 = f.submit 'Protect', class: "btn-create btn"
28 - unless @branches.empty?
29 %h5 Already Protected:
30 %ul.bordered-list.protected-branches-list
31 - @branches.each do |branch|
34 = link_to project_commits_path(@project, branch.name) do
36 - if @project.root_ref?(branch.name)
37 %span.label.label-info default
38 %span.label.label-success
41 - if can? current_user, :admin_project, @project
42 = link_to 'Unprotect', [@project, branch], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-remove btn-small"
44 - if commit = branch.commit
45 = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do
48 = gfm escape_once(truncate(commit.title, length: 40))
49 #{time_ago_with_tooltip(commit.committed_date)}
51 (branch was removed from repository)