seminar2/app/views/admin/seminars/_node_and_children.html.erb

20 lines
872 B
Plaintext
Raw Permalink Normal View History

2021-06-17 10:07:43 +00:00
<% 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 %>