Sha256: 1f71e47111548b22aa5c9c3c0940720d5663e07c39e979bcf43ed07b055aaea1
Contents?: true
Size: 1.25 KB
Versions: 8
Compression:
Stored size: 1.25 KB
Contents
- raise('expected a menu') unless menu.present? - menu = menu.to_s = cache(EffectiveResources.cache_key(menu, current_user, Effective::Page.all.cache_key_with_version)) do - # Renders menu_root? level pages and their immediate children - Effective::Page.for_menu_root(menu).each do |page| - next unless EffectiveResources.authorized?(self, :show, page) - next if (page.authenticate_user || page.roles.present?) && current_user.blank? - next if page.roles.present? && (current_user.roles & page.roles).blank? - if page.menu_children_blank? = nav_link_to(page.menu_to_s, (page.menu_url.presence || effective_pages.page_path(page))) - else = nav_dropdown(page.menu_to_s, groups: true) do - page.menu_children.group_by { |menu| menu.menu_group.presence }.each do |menu_group, pages| = nav_dropdown_group(menu_group || '') do - pages.each do |page| - next unless EffectiveResources.authorized?(self, :show, page) - next if (page.authenticate_user || page.roles.present?) && current_user.blank? - next if page.roles.present? && (current_user.roles & page.roles).blank? = nav_link_to(page.menu_to_s, (page.menu_url.presence || effective_pages.page_path(page)))
Version data entries
8 entries across 8 versions & 1 rubygems