diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-27 18:09:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-27 18:09:49 +0300 |
commit | 0407f1573d1b3468f9fdcdd363996acc9d3052b1 (patch) | |
tree | d5603e737a6860aa0bf1ce689b1d5dc1c7cfe6b2 /app/views/projects/branch_defaults | |
parent | c52a9411d8e66b8c6a1a1b3672626a326d73e884 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/views/projects/branch_defaults')
-rw-r--r-- | app/views/projects/branch_defaults/_default_branch_fields.html.haml | 16 | ||||
-rw-r--r-- | app/views/projects/branch_defaults/_show.html.haml | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/app/views/projects/branch_defaults/_default_branch_fields.html.haml b/app/views/projects/branch_defaults/_default_branch_fields.html.haml new file mode 100644 index 00000000000..e4f51725f1a --- /dev/null +++ b/app/views/projects/branch_defaults/_default_branch_fields.html.haml @@ -0,0 +1,16 @@ +%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.') + .js-select-default-branch{ data: { default_branch: @project.default_branch, project_id: @project.id } } + + .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 diff --git a/app/views/projects/branch_defaults/_show.html.haml b/app/views/projects/branch_defaults/_show.html.haml new file mode 100644 index 00000000000..6790a658dce --- /dev/null +++ b/app/views/projects/branch_defaults/_show.html.haml @@ -0,0 +1,16 @@ +- expanded = expanded_by_default? + +%section.settings.no-animate#branch-defaults-settings{ class: ('expanded' if expanded) } + .settings-header + %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Branch defaults') + = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do + = expanded ? _('Collapse') : _('Expand') + %p + = s_('ProjectSettings|Select the default branch for this project, and configure the template for branch names.') + + .settings-content + - url = namespace_project_settings_repository_path(@project.namespace, @project) + = gitlab_ui_form_for @project, url: url, method: :put, html: { multipart: true, class: "issue-settings-form js-issue-settings-form" }, authenticity_token: true do |f| + %input{ name: 'update_section', type: 'hidden', value: 'js-issue-settings' } + = render 'projects/branch_defaults/default_branch_fields', f: f + = f.submit _('Save changes'), pajamas_button: true, data: { qa_selector: 'save_changes_button' } |