File: _default_branch_fields.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (27 lines) | stat: -rw-r--r-- 2,293 bytes parent folder | download
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
- change_default_disabled = @default_branch_blocked_by_security_policy
- popover_data = {}

- if change_default_disabled
  - tag_pair_security_policies_page = tag_pair(link_to('', namespace_project_security_policies_path, target: '_blank', rel: 'noopener noreferrer'), :security_policies_link_start, :security_policies_link_end)
  - tag_pair_security_policies_docs = tag_pair(link_to('', help_page_path('user/application_security/policies/merge_request_approval_policies.md'), target: '_blank', rel: 'noopener noreferrer'), :learn_more_link_start, :learn_more_link_end)
  - popover_content = safe_format(s_("SecurityOrchestration|You can't change the default branch because its protection is enforced by one or more %{security_policies_link_start}security policies%{security_policies_link_end}. %{learn_more_link_start}Learn more%{learn_more_link_end}."), tag_pair_security_policies_docs, tag_pair_security_policies_page)
  - popover_title = s_("SecurityOrchestration|Security policy overwrites this setting")
  - popover_data = { container: 'body', toggle: 'popover', html: 'true', triggers: 'hover', title: popover_title, content: popover_content }

%fieldset#default-branch-settings
  - if @project.empty_repo?
    .text-secondary
      = s_('ProjectSettings|A default branch cannot be chosen for an empty project.')
  - else
    .form-group
      = f.label :default_branch, _("Default branch"), class: 'label-bold'
      %p= s_('ProjectSettings|All merge requests and commits are made against this branch unless you specify a different one.')
      .gl-form-input-xl{ data: { **popover_data } }
        .js-select-default-branch{ data: { default_branch: @project.default_branch, project_id: @project.id, disabled: change_default_disabled.to_s } }

  .form-group
    - help_text = _("When merge requests and commits in the default branch close, any issues they reference also close.")
    - help_icon = link_to sprite_icon('question-o'), help_page_path('user/project/issues/managing_issues.md', anchor: 'closing-issues-automatically'), target: '_blank', rel: 'noopener noreferrer'
    = f.gitlab_ui_checkbox_component :autoclose_referenced_issues,
        s_('ProjectSettings|Auto-close referenced issues on default branch'),
        help_text: (help_text + " " + help_icon).html_safe