summaryrefslogtreecommitdiff
path: root/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml')
-rw-r--r--app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml b/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml
new file mode 100644
index 00000000000..1e9aa4ec5ff
--- /dev/null
+++ b/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml
@@ -0,0 +1,14 @@
+- attribute = local_assigns.fetch(:attribute, nil)
+- group = local_assigns.fetch(:group, nil)
+- form = local_assigns.fetch(:form, nil)
+
+- return unless attribute && group && form && cascading_namespace_settings_enabled?
+- return if group.namespace_settings.public_send("#{attribute}_locked?")
+
+- lock_attribute = "lock_#{attribute}"
+
+.gl-form-checkbox.custom-control.custom-checkbox
+ = form.check_box lock_attribute, checked: group.namespace_settings.public_send(lock_attribute), class: 'custom-control-input', data: { testid: 'enforce-for-all-subgroups-checkbox' }
+ = form.label lock_attribute, class: 'custom-control-label' do
+ %span= s_('CascadingSettings|Enforce for all subgroups')
+ %p.help-text= s_('CascadingSettings|Subgroups cannot change this setting.')