File: _setting_checkbox.html.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (20 lines) | stat: -rw-r--r-- 974 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
- attribute = local_assigns.fetch(:attribute, nil)
- group = local_assigns.fetch(:group, nil)
- settings_path_helper = local_assigns.fetch(:settings_path_helper, nil)
- form = local_assigns.fetch(:form, nil)
- setting_locked = local_assigns.fetch(:setting_locked, false)
- help_text = local_assigns.fetch(:help_text, nil)
- checked = local_assigns.fetch(:checked, false)
- klass = local_assigns.fetch(:class, nil)

- return unless attribute && group && form && settings_path_helper

= form.gitlab_ui_checkbox_component attribute, checkbox_options: { checked: checked, disabled: setting_locked, class: klass } do |c|
  = c.with_label attribute, class: 'custom-control-label', aria: { disabled: setting_locked } do
    = render 'shared/namespaces/cascading_settings/setting_label_container' do
      = yield
      - if setting_locked
        = render 'shared/namespaces/cascading_settings/lock_icon', local_assigns
  - if help_text
    = c.with_help_text do
      = help_text