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
32
33
34
35
|
- page_title "保护分支"
%h3.page-title 保护分支
%p.light 此功能用于保护稳定分支被覆盖以及合并保护分支前必须强制代码评审
%hr
.well
%p 保护分支设计为:
%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 点击#{link_to "项目权限", 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|
-if @protected_branch.errors.any?
.alert.alert-danger
%ul
- @protected_branch.errors.full_messages.each do |msg|
%li= msg
.form-group
= f.label :name, "分支", 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: "选择分支"}})
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :developers_can_push do
= f.check_box :developers_can_push
%strong 开发者可以推送
.help-block 允许开发者推送到此分支
.form-actions
= f.submit '保护', class: "btn-create btn"
= render 'branches_list'
|