debian-mirror-gitlab/app/views/shared/_visibility_radios.html.haml

18 lines
890 B
Text
Raw Normal View History

2015-09-11 14:41:01 +05:30
- Gitlab::VisibilityLevel.values.each do |level|
2018-03-17 18:26:18 +05:30
- disallowed = disallowed_visibility_level?(form_model, level)
- restricted = restricted_visibility_levels.include?(level)
- disabled = disallowed || restricted
2018-11-08 19:23:39 +05:30
.form-check{ class: [('disabled' if disabled), ('restricted' if restricted)] }
= form.radio_button model_method, level, checked: (selected_level == level), disabled: disabled, class: 'form-check-input'
= form.label "#{model_method}_#{level}", class: 'form-check-label' do
2015-09-11 14:41:01 +05:30
= visibility_level_icon(level)
.option-title
= visibility_level_label(level)
2018-03-17 18:26:18 +05:30
.option-description
2015-09-11 14:41:01 +05:30
= visibility_level_description(level, form_model)
2018-03-17 18:26:18 +05:30
.option-disabled-reason
- if restricted
= restricted_visibility_level_description(level)
- elsif disallowed
= disallowed_visibility_level_description(level, form_model)