2014-05-23 07:25:55 -04:00
|
|
|
%h3.page-title Protected branches
|
2014-10-12 08:23:12 -04:00
|
|
|
%p.light Keep stable branches secure and force developers to use Merge Requests
|
2014-05-23 07:25:55 -04:00
|
|
|
%hr
|
2012-02-15 15:02:33 -05:00
|
|
|
|
2015-03-26 02:07:59 -04:00
|
|
|
.well.append-bottom-20
|
2014-09-22 06:25:07 -04:00
|
|
|
%p Protected branches are designed to
|
2014-05-23 07:25:55 -04:00
|
|
|
%ul
|
2014-09-22 06:25:07 -04:00
|
|
|
%li prevent pushes from everybody except #{link_to "masters", help_page_path("permissions", "permissions"), class: "vlink"}
|
2014-10-12 08:23:12 -04:00
|
|
|
%li prevent anyone from force pushing to the branch
|
|
|
|
%li prevent anyone from deleting the branch
|
2014-09-22 06:25:07 -04:00
|
|
|
%p Read more about #{link_to "project permissions", help_page_path("permissions", "permissions"), class: "underlined-link"}
|
2012-02-15 15:02:33 -05:00
|
|
|
|
2014-05-23 07:25:55 -04:00
|
|
|
- if can? current_user, :admin_project, @project
|
2015-01-24 13:02:58 -05:00
|
|
|
= form_for [@project.namespace.becomes(Namespace), @project, @protected_branch], html: { class: 'form-horizontal' } do |f|
|
2014-05-23 07:25:55 -04:00
|
|
|
-if @protected_branch.errors.any?
|
|
|
|
.alert.alert-danger
|
|
|
|
%ul
|
|
|
|
- @protected_branch.errors.full_messages.each do |msg|
|
|
|
|
%li= msg
|
2013-07-18 05:06:51 -04:00
|
|
|
|
2014-05-23 07:25:55 -04:00
|
|
|
.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"})
|
2014-12-26 03:14:53 -05:00
|
|
|
.form-group
|
2015-03-18 23:46:26 -04:00
|
|
|
.col-sm-offset-2.col-sm-10
|
2014-12-26 09:36:35 -05:00
|
|
|
.checkbox
|
2015-03-18 23:46:26 -04:00
|
|
|
= 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-05-23 07:25:55 -04:00
|
|
|
.form-actions
|
|
|
|
= f.submit 'Protect', class: "btn-create btn"
|
2014-12-26 09:36:35 -05:00
|
|
|
= render 'branches_list'
|
2014-05-23 07:25:55 -04:00
|
|
|
|