2015-09-11 14:41:01 +05:30
|
|
|
- page_title "Protected branches"
|
2014-09-02 18:07:02 +05:30
|
|
|
%h3.page-title Protected branches
|
2015-04-26 12:48:37 +05:30
|
|
|
%p.light Keep stable branches secure and force developers to use Merge Requests
|
2014-09-02 18:07:02 +05:30
|
|
|
%hr
|
|
|
|
|
2015-12-23 02:04:40 +05:30
|
|
|
.well
|
2015-04-26 12:48:37 +05:30
|
|
|
%p Protected branches are designed to
|
2014-09-02 18:07:02 +05:30
|
|
|
%ul
|
2015-04-26 12:48:37 +05:30
|
|
|
%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"}
|
2014-09-02 18:07:02 +05:30
|
|
|
|
|
|
|
- if can? current_user, :admin_project, @project
|
2015-04-26 12:48:37 +05:30
|
|
|
= form_for [@project.namespace.becomes(Namespace), @project, @protected_branch], html: { class: 'form-horizontal' } do |f|
|
2014-09-02 18:07:02 +05:30
|
|
|
-if @protected_branch.errors.any?
|
|
|
|
.alert.alert-danger
|
|
|
|
%ul
|
|
|
|
- @protected_branch.errors.full_messages.each do |msg|
|
|
|
|
%li= msg
|
|
|
|
|
|
|
|
.form-group
|
|
|
|
= f.label :name, "Branch", class: 'control-label'
|
|
|
|
.col-sm-10
|
2015-12-23 02:04:40 +05:30
|
|
|
= f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: true}, {class: "select2", data: {placeholder: "Select branch"}})
|
2015-04-26 12:48:37 +05:30
|
|
|
.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
|
2014-09-02 18:07:02 +05:30
|
|
|
.form-actions
|
|
|
|
= f.submit 'Protect', class: "btn-create btn"
|
2015-04-26 12:48:37 +05:30
|
|
|
= render 'branches_list'
|