Sha256: 22f690a53ddfd9c661d907eaa5a736f96dfe545b59a0b782eda15704850cc330

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

<nav class="<%= styles[:container] %>">
  <ul role="list" class="p-0 m-0">
    <% if @show_heading %>
      <li>
        <a href="<%= menu_item.page.path %>" class="<%= menu_item.page == PandaCms::Current.page ? styles[:current_page_active] : styles[:current_page_inactive] %>">
          <%= menu_item.text %>
        </a>
      </li>
    <% end %>
    <ul>
      <% PandaCms::MenuItem.includes(:page).each_with_level(menu_item.descendants) do |submenu_item, level| %>
        <% next if PandaCms::Current.page == menu_item.page && level > 1 # If we're on the "top" menu item, only show its direct ancestors %>
        <% next if submenu_item.page.depth > PandaCms::Current.page.depth && !PandaCms::Current.page.in?(submenu_item.page.ancestors) %>
        <li data-level="<%= level %>" data-page-id="<%= submenu_item.page.id %>" class="<%= submenu_item.page == PandaCms::Current.page ? @styles[:active] : @styles[:inactive] %>">
          <a href="<%= submenu_item.page.path %>" class="<%= helpers.menu_indent(submenu_item, indent_with: @styles[:indent_with]) %>"><%= submenu_item.page.title %></a>
        </li>
      <% end %>
    </ul>
  </ul>
</nav>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
panda_cms-0.6.3 app/components/panda_cms/page_menu_component.html.erb
panda_cms-0.6.2 app/components/panda_cms/page_menu_component.html.erb
panda_cms-0.6.1 app/components/panda_cms/page_menu_component.html.erb