提交 85d685c7 编写于 作者: S Samantha Ming

Move haml files to EE render partials

- create partials for code owner form, table, & table headers
上级 c858c35d
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
= s_("ProtectedBranch|Allowed to merge") = s_("ProtectedBranch|Allowed to merge")
%th %th
= s_("ProtectedBranch|Allowed to push") = s_("ProtectedBranch|Allowed to push")
- if @project.merge_requests_require_code_owner_approval
%th = render_if_exists 'shared/projects/code_owner_approval_table_head'
= s_("ProtectedBranch|Code owner approval")
- if can_admin_project - if can_admin_project
%th %th
%tbody %tbody
......
...@@ -24,19 +24,6 @@ ...@@ -24,19 +24,6 @@
= s_("ProtectedBranch|Allowed to push:") = s_("ProtectedBranch|Allowed to push:")
.col-md-10 .col-md-10
= yield :push_access_levels = yield :push_access_levels
= render_if_exists 'shared/projects/code_owner_approval_form'
- 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")
.card-footer .card-footer
= f.submit s_('ProtectedBranch|Protect'), class: 'btn-success btn', disabled: true = f.submit s_('ProtectedBranch|Protect'), class: 'btn-success btn', disabled: true
...@@ -19,14 +19,7 @@ ...@@ -19,14 +19,7 @@
= yield = yield
- if @project.merge_requests_require_code_owner_approval = render_if_exists 'shared/projects/code_owner_approval_table', protected_branch: protected_branch
%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 can_admin_project - if can_admin_project
%td %td
......
...@@ -87,11 +87,7 @@ Click **Protect** and the branch will appear in the "Protected branch" list. ...@@ -87,11 +87,7 @@ Click **Protect** and the branch will appear in the "Protected branch" list.
## Code Owners approvals **(PREMIUM)** ## Code Owners approvals **(PREMIUM)**
It is possible to require at least one approval for each entry in the 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
=======
[`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: the merge request. To enable this feature:
1. Toggle the **Require approval from code owners** slider. 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 is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册