Sha256: 378193e0c59f418f909397a3b100f6d9508cfcb7d1453affe5095525cd38ca38
Contents?: true
Size: 1.17 KB
Versions: 20
Compression:
Stored size: 1.17 KB
Contents
- raise('expected a menu') unless menu.present? - menu = menu.to_s - # 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? - menu_children = page.menu_children - if menu_children.blank? = nav_link_to(page.menu_to_s, (page.menu_url.presence || effective_pages.page_path(page))) - if menu_children.present? = nav_dropdown(page.menu_to_s, groups: true) do - 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
20 entries across 20 versions & 1 rubygems