<% unless node.root? %>
  <li id='<%= node.id %>' data-page-id="<%= node.page_id rescue "" %>" data-level="<%= level.to_s %>" data-page-module="<%= node.module rescue "" %>" data-page-title="<%= node.name rescue "" %>" class="<%= 'disabled' unless !node.enabled_for.empty? %> <%= 'collapsed' unless node.child_page.blank?  %>" >
<% end %>
  <%= render 'node', {node: node, level: level} rescue render 'admin/items/node', {node: node, level: level} %>
  <% unless node.child_page.blank? %>
    <% unless node.root? %>
      <ol>
    <% end %>
    <% node.child_page.asc(:number).each do |child| %>
      <%= render 'node_and_children', {node: child, level: level + 1} rescue render 'admin/items/node_and_children', {node: child, level: level + 1} %>
    <% end %>
    <% unless node.root? %>
      </ol>
    <% end %>
  <% end %>

<% unless node.root? %>
  </li>
<% end %>
