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

Version Path
effective_pages-3.8.4 app/views/effective/pages/_menu.html.haml
effective_pages-3.8.3 app/views/effective/pages/_menu.html.haml
effective_pages-3.8.2 app/views/effective/pages/_menu.html.haml
effective_pages-3.8.1 app/views/effective/pages/_menu.html.haml
effective_pages-3.8.0 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.11 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.10 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.9 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.8 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.7 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.6 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.5 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.4 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.3 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.2 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.1 app/views/effective/pages/_menu.html.haml
effective_pages-3.7.0 app/views/effective/pages/_menu.html.haml
effective_pages-3.6.0 app/views/effective/pages/_menu.html.haml
effective_pages-3.5.0 app/views/effective/pages/_menu.html.haml
effective_pages-3.4.13 app/views/effective/pages/_menu.html.haml