gitlab-org--gitlab-foss/app/views/shared/_visibility_radios.html.haml

17 lines
833 B
Text

- Gitlab::VisibilityLevel.values.each do |level|
- disallowed = disallowed_visibility_level?(form_model, level)
- restricted = restricted_visibility_levels.include?(level)
- disabled = disallowed || restricted
.radio{ class: [('disabled' if disabled), ('restricted' if restricted)] }
= form.label "#{model_method}_#{level}" do
= form.radio_button model_method, level, checked: (selected_level == level), disabled: disabled
= visibility_level_icon(level)
.option-title
= visibility_level_label(level)
.option-description
= visibility_level_description(level, form_model)
.option-disabled-reason
- if restricted
= restricted_visibility_level_description(level)
- elsif disallowed
= disallowed_visibility_level_description(level, form_model)