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

18 lines
833 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
.radio{ class: [('disabled' if disabled), ('restricted' if restricted)] }
2015-09-11 14:41:01 +05:30
= form.label "#{model_method}_#{level}" do
2018-03-17 18:26:18 +05:30
= form.radio_button model_method, level, checked: (selected_level == level), disabled: disabled
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)