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 38 39 40 41 42 43 44
|
.form-group
%legend.h5.gl-border-none.gl-mt-0.gl-mb-3= _('Initial default branch protection')
- Gitlab::Access.global_protection_levels.each do |level|
= f.gitlab_ui_radio_component :default_branch_protected?, level[:value], level[:label], help_text: level[:help_text], radio_options: { class: 'js-global-protection-levels' }
.js-global-protection-levels-protected.gl-ml-7
%legend.h6.gl-my-3.gl-border-none.gl-font-normal= s_('ProtectedBranch|Allowed to push')
- allowed_to_push_access_level = value['allowed_to_push'][0]['access_level']
- ProtectedBranch::PushAccessLevel.human_access_levels.each do |id, text|
= render Pajamas::RadioTagComponent.new(name: "#{field}[default_branch_protection_defaults][allowed_to_push][][access_level]",
label: text,
value: id,
checked: allowed_to_push_access_level == id)
%legend.h6.gl-my-3.gl-border-none.gl-font-normal= s_('ProtectedBranch|Allowed to merge')
- allowed_to_merge_access_level = value['allowed_to_merge'][0]['access_level']
- ProtectedBranch::MergeAccessLevel.human_access_levels.each do |id, text|
= render Pajamas::RadioTagComponent.new(name: "#{field}[default_branch_protection_defaults][allowed_to_merge][][access_level]",
label: text,
value: id,
checked: allowed_to_merge_access_level == id)
- allow_force_push = value['allow_force_push']
= render Pajamas::CheckboxTagComponent.new(name: "#{field}[default_branch_protection_defaults][allow_force_push]",
label_options: { class: "gl-mt-5" },
checked: allow_force_push) do |c|
- c.with_label do
= s_("ProtectedBranch|Allowed to force push")
- c.with_help_text do
- force_push_docs_url = help_page_url('topics/git/git_rebase.md', anchor: 'force-push-to-a-remote-branch')
- force_push_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: force_push_docs_url }
= (s_("ProtectedBranch|Allow all users with push access to %{tag_start}force push%{tag_end}.") % { tag_start: force_push_link_start, tag_end: '</a>' }).html_safe
= render_if_exists 'shared/default_branch_protection_defaults_code_owner_approval', f: f, field: field
- developer_can_initial_push = value['developer_can_initial_push']
= render Pajamas::CheckboxTagComponent.new(name: "#{field}[default_branch_protection_defaults][developer_can_initial_push]",
label_options: { class: "gl-mt-5" },
checked: developer_can_initial_push) do |c|
- c.with_label do
= s_("ProtectedBranch|Allow developers to push to the initial commit")
- c.with_help_text do
= s_("ProtectedBranch|Developers can push the initial commit to a repository, but none afterward.")
|