2015-04-26 01:01:52 -04:00
|
|
|
- Gitlab::VisibilityLevel.values.each do |level|
|
2017-08-25 14:46:49 -04:00
|
|
|
- disallowed = disallowed_visibility_level?(form_model, level)
|
|
|
|
- restricted = restricted_visibility_levels.include?(level)
|
|
|
|
- disabled = disallowed || restricted
|
2018-04-18 12:43:53 -04:00
|
|
|
.form-check.pl-0{ class: [('disabled' if disabled), ('restricted' if restricted)] }
|
2015-05-16 16:09:04 -04:00
|
|
|
= form.label "#{model_method}_#{level}" do
|
2017-08-30 17:27:20 -04:00
|
|
|
= form.radio_button model_method, level, checked: (selected_level == level), disabled: disabled
|
2015-04-26 01:01:52 -04:00
|
|
|
= visibility_level_icon(level)
|
|
|
|
.option-title
|
|
|
|
= visibility_level_label(level)
|
2017-08-25 14:48:15 -04:00
|
|
|
.option-description
|
2015-04-26 01:01:52 -04:00
|
|
|
= visibility_level_description(level, form_model)
|
2017-08-25 14:48:15 -04:00
|
|
|
.option-disabled-reason
|
|
|
|
- if restricted
|
2017-08-25 16:01:56 -04:00
|
|
|
= restricted_visibility_level_description(level)
|
2017-08-25 14:48:15 -04:00
|
|
|
- elsif disallowed
|
2017-08-25 16:01:56 -04:00
|
|
|
= disallowed_visibility_level_description(level, form_model)
|