Sha256: f8f54caaed45bd9cd633cabf3351342df025d2e585f6c4d519d6fe1f8f670976
Contents?: true
Size: 1 KB
Versions: 3
Compression:
Stored size: 1 KB
Contents
- raise('expected a menu') unless menu.present? - menu = menu.to_s - 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.select { |page| page.menu_name == menu } - if menu_children.blank? = nav_link_to((page.menu_title.presence || page.title), (page.menu_url.presence || effective_pages.page_path(page))) - else = nav_dropdown(page.to_s) do - menu_children.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_title.presence || page.title), (page.menu_url.presence || effective_pages.page_path(page)))
Version data entries
3 entries across 3 versions & 1 rubygems