summaryrefslogtreecommitdiff
path: root/app/views/projects/protected_branches/index.html.haml
blob: 653b02da4dbbb10d1bf10c952dd3ac479326f555 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- page_title "Protected branches"
%h3.page-title Protected branches
%p.light Keep stable branches secure and force developers to use Merge Requests
%hr

.well
  %p Protected branches are designed to
  %ul
    %li prevent pushes from everybody except #{link_to "masters", help_page_path("permissions", "permissions"), class: "vlink"}
    %li prevent anyone from force pushing to the branch
    %li prevent anyone from deleting the branch
  %p Read more about #{link_to "project permissions", help_page_path("permissions", "permissions"), class: "underlined-link"}

- if can? current_user, :admin_project, @project
  = form_for [@project.namespace.becomes(Namespace), @project, @protected_branch], html: { class: 'form-horizontal' } do |f|
    = form_errors(@protected_branch)

    .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: true}, {class: "select2", data: {placeholder: "Select branch"}})
    .form-group
      .col-sm-offset-2.col-sm-10
        .checkbox
          = f.label :developers_can_push do
            = f.check_box :developers_can_push
            %strong Developers can push
          .help-block Allow developers to push to this branch
    .form-actions
      = f.submit 'Protect', class: "btn-create btn"
= render 'branches_list'