summaryrefslogtreecommitdiff
path: root/app/views/shared/namespaces/cascading_settings/_enforcement_checkbox.html.haml
blob: ab4d8816ec92a2ff1f351fa813344c16f99fce6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
- attribute = local_assigns.fetch(:attribute, nil)
- form = local_assigns.fetch(:form, nil)
- setting_locked = local_assigns.fetch(:setting_locked, false)
- help_text = local_assigns.fetch(:help_text, s_('CascadingSettings|Subgroups cannot change this setting.'))

- return unless attribute && group && form && cascading_namespace_settings_enabled?
- return if setting_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
      = yield.presence || s_('CascadingSettings|Enforce for all subgroups')
    %p.help-text
      = help_text