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

{% block title %}{{ 'List circles'|trans }}{% endblock %}

{% block admin_content -%}
    {% embed '@ChillMain/CRUD/_index.html.twig' %}

        {% block index_header %}
            <h1>{{ 'List circles'|trans }}</h1>
        {% endblock %}

        {% block filter_order %}{% endblock %}

        {% block table_entities_thead_tr %}
            <th>id</th>
            <th>{{ 'Name'|trans }}</th>
            <th>{{ 'Active'|trans }}</th>
            <th>{{ 'Actions'|trans }}</th>
        {% endblock %}

        {% block table_entities_tbody %}
            {% for entity in entities %}
                <tr>
                    <td>{{ entity.id }}</td>
                    <td>{{ entity.name|localize_translatable_string }}</td>
                    <td style="text-align:center;">
                        {%- if entity.active -%}
                            <i class="fa fa-check-square-o"></i>
                        {%- else -%}
                            <i class="fa fa-square-o"></i>
                        {%- endif -%}
                    </td>
                    <td>
                        <ul class="record_actions">
                            <li>
                                <a href="{{ path('admin_scope_edit', { 'id': entity.id }) }}" class="btn btn-edit">{{ 'edit'|trans }}</a>
                            </li>
                        </ul>
                    </td>
                </tr>
            {% endfor %}
        {% endblock %}

        {% block pagination %}{% endblock %}

        {% block list_actions %}
            <ul class="record_actions sticky-form-buttons">
                <li class='cancel'>
                    <a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
                </li>
                <li>
                    <a href="{{ path('admin_scope_new') }}" class="btn btn-create">{{ 'Create a new circle'|trans }}</a>
                </li>
            </ul>
        {% endblock list_actions %}

    {% endembed %}
{% endblock %}
