<%= content_tag :li, class: 'menu-item', data: { id: node.id, parent_id: node.parent_id, folded: node.folded?, type: "node" } do %> <%= content_tag :div, class: [ 'sitemap_node', node.external? ? 'external' : 'internal', "sitemap_node-level_#{node.depth}" ] do %>   <% if can?(:edit, node) %> <%= link_to_dialog( render_icon(:edit), alchemy.edit_admin_node_path(node), { title: node.root? ? Alchemy.t(:edit_menu) : Alchemy.t(:edit_node), size: node.root? ? '450x120' : '450x360' }, class: "icon_button" ) %> <% end %> <% if can?(:destroy, node) %> <%= link_to_confirm_dialog( render_icon("delete-bin-2"), node.root? ? Alchemy.t(:confirm_to_delete_menu) : Alchemy.t(:confirm_to_delete_node), url_for( controller: 'nodes', action: 'destroy', id: node.id ), { class: "icon_button" }, ) %> <% end %> <% if can?(:create, Alchemy::Node) %> <%= link_to_dialog( render_icon(:add), alchemy.new_admin_node_path(parent_id: node.id), { title: Alchemy.t(:create_node), size: '450x360', overflow: true }, class: "icon_button" ) %> <% end %>
<%= node.name || ' '.html_safe %> <% if node.page %> <%= link_to [:edit, :admin, node.page], title: Alchemy.t(:edit_page) do %> <%= node.page.name %> <% end %> <% end %> <% if node.url %> <%= link_to node.url, node.url, target: '_blank', title: node.url %> <% if node.external? %> <% end %> <% end %>
<% end %> <%= content_tag :ul, class: "children #{' folded' if node.folded?}", data: { record_id: node.id } do %> <%= render partial: 'node', collection: node.children.includes(:page, :children) %> <% end %> <% end %>