index.html.haml 1.4 KB
Newer Older
1
%h3.page-title Protected branches
2
%p.light Keep stable branches secure and force developers to use Merge Requests
3
%hr
4

5
.alert.alert-info
6
  %p Protected branches are designed to
7
  %ul
8
    %li prevent pushes from everybody except #{link_to "masters", help_page_path("permissions", "permissions"), class: "vlink"}
9 10
    %li prevent anyone from force pushing to the branch
    %li prevent anyone from deleting the branch
11
  %p Read more about #{link_to "project permissions", help_page_path("permissions", "permissions"), class: "underlined-link"}
12

13
- if can? current_user, :admin_project, @project
V
Vinnie Okada 已提交
14
  = form_for [@project.namespace.becomes(Namespace), @project, @protected_branch], html: { class: 'form-horizontal' } do |f|
15 16 17 18 19
    -if @protected_branch.errors.any?
      .alert.alert-danger
        %ul
          - @protected_branch.errors.full_messages.each do |msg|
            %li= msg
20

21 22 23 24
    .form-group
      = f.label :name, "Branch", class: 'control-label'
      .col-sm-10
        = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "select2"})
25
    .form-group
26 27
      = f.label :developers_can_push, class: 'control-label' do
        Developers can push
28
      .col-sm-10
29 30 31
        .checkbox
          = f.check_box :developers_can_push
          %span.descr Allow developers to push to this branch
32 33
    .form-actions
      = f.submit 'Protect', class: "btn-create btn"
34
= render 'branches_list'
35