diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-08-25 21:46:49 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-08-26 11:31:14 +0300 |
commit | 10a7478ed0b9cbc4b3d4a316f4e124796dbac495 (patch) | |
tree | 32e94fe3fe44ee29bf2df395c0e05cdbca3e2130 /app/views/shared/_visibility_radios.html.haml | |
parent | 69f679ed3476a887e67a591114c50ebcd1efa1a6 (diff) |
fix disabled state style for visibility level options
Diffstat (limited to 'app/views/shared/_visibility_radios.html.haml')
-rw-r--r-- | app/views/shared/_visibility_radios.html.haml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/views/shared/_visibility_radios.html.haml b/app/views/shared/_visibility_radios.html.haml index 7b9453943d1..d8d1093d4e3 100644 --- a/app/views/shared/_visibility_radios.html.haml +++ b/app/views/shared/_visibility_radios.html.haml @@ -1,9 +1,10 @@ - Gitlab::VisibilityLevel.values.each do |level| - - next if disallowed_visibility_level?(form_model, level) - .radio - - restricted = restricted_visibility_levels.include?(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: restricted + = form.radio_button model_method, level, checked: (selected_level == level), disabled: disabled = visibility_level_icon(level) .option-title = visibility_level_label(level) |