{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}

{% block admin_content -%}

    <h1>{{ 'Role list'|trans }}</h1>

    <table class="table table-bordered border-dark align-middle">
        <thead>
            <tr>
                <th>{{ 'Id'|trans }}</th>
                <th>{{ 'Role'|trans }}</th>
                <th>{{ 'Type'|trans }}</th>
                <th>{{ 'Active'|trans }}</th>
                <th>{{ 'Actions'|trans }}</th>
            </tr>
        </thead>
        <tbody>
        {% for entity in entities %}
            <tr>
                <td>{{ entity.id }}</a></td>
                <td>{{ entity.name|localize_translatable_string }}</td>
                <td>{{ entity.type.name|localize_translatable_string }}</td>
                <td><i class="fa {% if entity.active %}fa-check-square-o{% else %}fa-square-o{% endif %}"></i></td>
                <td>
                    <ul class="record_actions">
                        <li>
                            <a href="{{ path('chill_event_admin_role_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a>
                        </li>
                    </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <ul class="record_actions">
        <li>
            <a href="{{ path('chill_event_admin_role_new') }}" class="btn btn-new">{{ 'Create a new role'|trans }}</a>
        </li>
    </ul>
    {% endblock %}
