diff options
Diffstat (limited to 'app/helpers/visibility_level_helper.rb')
-rw-r--r-- | app/helpers/visibility_level_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb index 896dcdd2caf..0a37257e124 100644 --- a/app/helpers/visibility_level_helper.rb +++ b/app/helpers/visibility_level_helper.rb @@ -157,6 +157,16 @@ module VisibilityLevelHelper end end + def visibility_level_options(form_model) + available_visibility_levels(form_model).map do |level| + { + level: level, + label: visibility_level_label(level), + description: visibility_level_description(level, form_model) + } + end + end + def snippets_selected_visibility_level(visibility_levels, selected) visibility_levels.find { |level| level == selected } || visibility_levels.min end |