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

19 lines
1.1 KiB
Text

- available_visibility_levels = available_visibility_levels(form_model)
- selected_level = snippets_selected_visibility_level(available_visibility_levels, selected_level)
- available_visibility_levels.each do |level|
.form-check
= form.radio_button model_method, level, checked: (selected_level == level), class: 'form-check-input', data: { track_label: "blank_project", track_action: "activate_form_input", track_property: "#{model_method}_#{level}", track_value: "", qa_selector: "#{visibility_level_label(level).downcase}_radio" }
= form.label "#{model_method}_#{level}", class: 'form-check-label' do
= visibility_level_icon(level)
.option-title
= visibility_level_label(level)
.option-description
= visibility_level_description(level, form_model)
.option-disabled-reason
.text-muted
- if all_visibility_levels_restricted?
= _('Visibility settings have been disabled by the administrator.')
- elsif multiple_visibility_levels_restricted?
= _('Other visibility settings have been disabled by the administrator.')