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 36 37
|
- can_admin_entity = protected_branch_can_admin_entity?(protected_branch_entity)
- expanded = expanded_by_default?
= render ::Layouts::SettingsBlockComponent.new(s_("ProtectedBranch|Protected branches"),
id: 'js-protected-branches-settings',
testid: 'protected-branches-settings-content',
expanded: expanded) do |c|
- c.with_description do
= s_("ProtectedBranch|Keep stable branches secure and force developers to use merge requests.")
= link_to s_("ProtectedBranch|What are protected branches?"), help_page_path("user/project/repository/branches/protected.md")
- c.with_body do
.js-alert-protected-branch-created-container.gl-mt-5
= render Pajamas::AlertComponent.new(variant: :warning,
alert_options: { class: 'gl-mb-5' },
dismissible: false) do |c|
- c.with_body do
= s_("ProtectedBranch|Giving merge rights to a protected branch also gives elevated permissions for certain CI/CD features.")
= link_to s_("ProtectedBranch|What are the security implications?"), help_page_path('ci/pipelines/index.md', anchor: 'pipeline-security-on-protected-branches'), target: '_blank', rel: 'noopener noreferrer'
= render ::Layouts::CrudComponent.new(s_("ProtectedBranch|Protected branches"),
icon: 'branch',
count: @protected_branches.size,
toggle_text: _('Add protected branch'),
toggle_options: { data: { testid: 'add-protected-branch-button' } }) do |c|
- c.with_description do
= s_("ProtectedBranch|By default, protected branches restrict who can modify the branch.")
= link_to s_("ProtectedBranch|Learn more."), help_page_path("user/project/repository/branches/protected.md", anchor: "who-can-modify-a-protected-branch")
- c.with_body do
= content_for :branches_list
- c.with_form do
- if can_admin_entity
= content_for :create_protected_branch
- c.with_pagination do
= paginate @protected_branches, theme: 'gitlab', params: { anchor: 'js-protected-branches-settings' }
|