Коммит 2b80d3d0 создал по автору Samantha Ming's avatar Samantha Ming
Просмотр файлов

Move haml files to EE render partials

- create partials for code owner form, table, & table headers
владелец cd1e0ca4
......@@ -23,9 +23,9 @@
= s_("ProtectedBranch|Allowed to merge")
%th
= s_("ProtectedBranch|Allowed to push")
- if @project.merge_requests_require_code_owner_approval
%th
= s_("ProtectedBranch|Code owner approval")
= render_if_exists 'shared/projects/code_owner_approval_table_head'
- if can_admin_project
%th
%tbody
......
......@@ -24,19 +24,6 @@
= s_("ProtectedBranch|Allowed to push:")
.col-md-10
= yield :push_access_levels
- if @project.merge_requests_require_code_owner_approval
.form-group.row
%label.col-md-2.text-right{ for: 'code_owner_approval_required' }
= s_("ProtectedBranch|Require approval from code owners:")
.col-md-10
%button{ type: 'button',
class: "js-project-feature-toggle project-feature-toggle is-checked",
"aria-label": s_("ProtectedBranch|Toggle code owner approval") }
%span.toggle-icon
= sprite_icon('status_success_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-checked')
= sprite_icon('status_failed_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-unchecked')
.form-text.text-muted
= s_("ProtectedBranch|Pushes that change filenames matched by the CODEOWNERS file will be rejected")
= render_if_exists 'shared/projects/code_owner_approval_form'
.card-footer
= f.submit s_('ProtectedBranch|Protect'), class: 'btn-success btn', disabled: true
......@@ -19,14 +19,7 @@
= yield
- if @project.merge_requests_require_code_owner_approval
%td
%button{ type: 'button',
class: "js-project-feature-toggle project-feature-toggle mr-5 #{'is-checked' if protected_branch.code_owner_approval_required}",
"aria-label": s_("ProtectedBranch|Toggle code owner approval") }
%span.toggle-icon
= sprite_icon('status_success_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-checked')
= sprite_icon('status_failed_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-unchecked')
= render_if_exists 'shared/projects/code_owner_approval_table', protected_branch: protected_branch
- if can_admin_project
%td
......
......@@ -87,11 +87,7 @@ Click **Protect** and the branch will appear in the "Protected branch" list.
## Code Owners approvals **(PREMIUM)**
It is possible to require at least one approval for each entry in the
<<<<<<< HEAD
[`CODEOWNERS` file](code_owners.md) that matches a file changed in
=======
[`CODEOWNERS` file](../code_owners.md) that matches a file changed in
>>>>>>> Update docs to reflect changes to API and UI
the merge request. To enable this feature:
1. Toggle the **Require approval from code owners** slider.
......
- if @project.merge_requests_require_code_owner_approval
.form-group.row
%label.col-md-2.text-right{ for: 'code_owner_approval_required' }
= s_("ProtectedBranch|Require approval from code owners:")
.col-md-10
%button{ type: 'button',
class: "js-project-feature-toggle project-feature-toggle is-checked",
"aria-label": s_("ProtectedBranch|Toggle code owner approval") }
%span.toggle-icon
= sprite_icon('status_success_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-checked')
= sprite_icon('status_failed_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-unchecked')
.form-text.text-muted
= s_("ProtectedBranch|Pushes that change filenames matched by the CODEOWNERS file will be rejected")
- if @project.merge_requests_require_code_owner_approval
%td
%button{ type: 'button',
class: "js-project-feature-toggle project-feature-toggle mr-5 #{'is-checked' if protected_branch.code_owner_approval_required}",
"aria-label": s_("ProtectedBranch|Toggle code owner approval") }
%span.toggle-icon
= sprite_icon('status_success_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-checked')
= sprite_icon('status_failed_borderless', size: 16, css_class: 'toggle-icon-svg toggle-status-unchecked')
- if @project.merge_requests_require_code_owner_approval
%th
= s_("ProtectedBranch|Code owner approval")
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать