{{ pageSetVar('title', 'Menu list'|trans) }}
<h3><span class="fas fa-list"></span> {% trans %}Menus{% endtrans %}</h3>
<table id="menu-list" class="table table-bordered table-striped">
    <colgroup>
        <col id="cMenuId" />
        <col id="cMenuTitle" />
        <col id="cMenuChildCount" />
        <col id="cMenuActions" />
    </colgroup>
    <thead>
        <tr>
            <th id="hMenuId" scope="col">{% trans %}ID{% endtrans %}</th>
            <th id="hMenuTitle" scope="col">{% trans %}Title{% endtrans %}</th>
            <th id="hMenuChildCount" scope="col">{% trans %}Children{% endtrans %}</th>
            <th id="hMenuActions" scope="col" class="text-right">{% trans %}Actions{% endtrans %}</th>
        </tr>
    </thead>
    <tbody>
        {% for node in rootNodes %}
        <tr>
            <td headers="hMenuId">{{ node.id }}</td>
            <td headers="hMenuTitle"><strong>{{ node.title }}</strong></td>
            <td headers="hMenuChildCount">
                {{ 'plural_n.direct.child'|trans({count: node.children.count})|desc('{count, plural,\n  one   {one direct child}\n  other {# direct children}\n}') }}
            </td>
            <td headers="hMenuActions" class="actions">
                {% set rowActions = knp_menu_get('zikulaMenuAdminActionsMenu', [], {id: node.id}) %}
                {{ knp_menu_render(rowActions, {template: '@ZikulaMenuModule/Override/actions.html.twig'}) }}
            </td>
        </tr>
        {% else %}
        <tr class="table-info"><td colspan="4" class="text-center">{% trans %}No items found.{% endtrans %}</td></tr>
        {% endfor %}
    </tbody>
</table>
