2021-04-29 21:17:54 +05:30
|
|
|
- attribute = local_assigns.fetch(:attribute, nil)
|
2021-09-30 23:02:18 +05:30
|
|
|
- group = local_assigns.fetch(:group, nil)
|
2021-04-29 21:17:54 +05:30
|
|
|
- form = local_assigns.fetch(:form, nil)
|
2021-06-08 01:23:25 +05:30
|
|
|
- setting_locked = local_assigns.fetch(:setting_locked, false)
|
|
|
|
- help_text = local_assigns.fetch(:help_text, s_('CascadingSettings|Subgroups cannot change this setting.'))
|
2021-04-29 21:17:54 +05:30
|
|
|
|
2021-09-30 23:02:18 +05:30
|
|
|
- return unless attribute && group && form
|
2021-06-08 01:23:25 +05:30
|
|
|
- return if setting_locked
|
2021-04-29 21:17:54 +05:30
|
|
|
|
|
|
|
- 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
|
2021-06-08 01:23:25 +05:30
|
|
|
%span
|
|
|
|
= yield.presence || s_('CascadingSettings|Enforce for all subgroups')
|
|
|
|
%p.help-text
|
|
|
|
= help_text
|