<h3>
    <span class="fas fa-list"></span>
    {% trans %}Module categories list{% endtrans %}
    {{ pageSetVar('title', 'Module categories list'|trans) }}
</h3>
<table class="table table-bordered table-striped">
    <colgroup>
        <col id="cName" />
        <col id="cActions" />
    </colgroup>
    <thead>
        <tr>
            <th id="hName" scope="col">{% trans %}Name{% endtrans %}</th>
            <th id="hDescription" scope="col">{% trans %}Description{% endtrans %}</th>
            <th id="hIcon" scope="col" class="text-center">{% trans %}Icon{% endtrans %}</th>
            <th id="hActions" scope="col">{% trans %}Actions{% endtrans %}</th>
        </tr>
    </thead>
    <tbody>
        {% for category in paginator.results %}
            {% set permissionInstance = category.name ~ '::' ~ category.cid %}
            {% if hasPermission('ZikulaAdminModule::', permissionInstance, 'ACCESS_READ') %}
                {% set accessEdit = hasPermission('ZikulaAdminModule::', permissionInstance, 'ACCESS_EDIT') %}
                {% set accessDelete = hasPermission('ZikulaAdminModule::', permissionInstance, 'ACCESS_DELETE') %}
                <tr>
                    <th id="category{{ category.cid}}" headers="hName" scope="col">
                        <a href="{{ path('zikulaadminmodule_admin_adminpanel', { acid: category.cid }) }}">{{ category.name }}</a>
                    </th>
                    <td headers="category{{ category.cid}} hDescription">
                        {{ category.description|u.truncate(200, '…') }}
                    </td>
                    <td headers="category{{ category.cid}} hIcon" class="text-center">
                        {% if category.icon %}
                            <i class="{{ category.icon|e('html_attr') }}"></i>
                        {% else %}
                            {% trans %}None{% endtrans %}
                        {% endif %}
                    </td>
                    <td headers="category{{ category.cid}} hActions" class="actions">
                        {% if accessEdit %}
                            <a href="{{ path('zikulaadminmodule_admin_modify', {cid: category.cid}) }}" title="{% trans %}Edit{% endtrans %}" class="tooltips fas fa-pencil-alt"></a>
                        {% endif %}
                        {% if accessDelete %}
                            <a href="{{ path('zikulaadminmodule_admin_delete', {cid: category.cid}) }}" title="{% trans %}Delete{% endtrans %}" class="tooltips fas fa-trash-alt"></a>
                        {% endif %}
                    </td>
                </tr>
            {% endif %}
        {% else %}
            <tr class="table-info"><td colspan="4" class="text-center">{% trans %}No items found.{% endtrans %}</td></tr>
        {% endfor %}
    </tbody>
</table>
{{ include(paginator.template) }}
