Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_setting_label.html.haml « cascading_settings « namespaces « shared « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6596ce2bc73da051e8b94fc320aea0020ad0a4f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
- attribute = local_assigns.fetch(:attribute, nil)
- group = local_assigns.fetch(:group, nil)
- form = local_assigns.fetch(:form, nil)
- settings_path_helper = local_assigns.fetch(:settings_path_helper, nil)
- help_text = local_assigns.fetch(:help_text, nil)

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

- setting_locked = group.namespace_settings.public_send("#{attribute}_locked?")

= form.label attribute, class: 'custom-control-label', aria: { disabled: setting_locked } do
  %span.position-relative.gl-pr-6.gl-display-inline-flex
    = yield
    - if setting_locked
      %button.position-absolute.gl-top-3.gl-right-0.gl-translate-y-n50.gl-cursor-default.btn.btn-default.btn-sm.gl-button.btn-default-tertiary.js-cascading-settings-lock-popover-target{ class: 'gl-p-1! gl-text-gray-600! gl-bg-transparent!',
        type: 'button',
        data: cascading_namespace_settings_popover_data(attribute, group, settings_path_helper) }
        = sprite_icon('lock', size: 16)
  - if help_text
    %p.help-text
      = help_text