{% extends '@CpCreationVitiCore/admin/base.html.twig' %}

{% block content %}
    <div class="panel panel-default">
        <div class="panel-heading">
           Langues
            <div class="pull-right">
                <div class="btn-group">
                    <a href="{{ path('admin_locale_new') }}" type="button" class="btn btn-default btn-xs">
                        Ajouter
                    </a>
                </div>
            </div>
        </div>
        <table class="table table-striped">
            <thead>
            <tr>
                <th>#</th>
                <th>Nom</th>
                <th>locale</th>
                <th>Position</th>
                <th>Action</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>#</td>
                <td>Français</td>
                <td>fr</td>
                <td></td>
            </tr>
            {% for item in items %}
                <tr>
                    <td>{{ loop.index }}</td>
                    <td>{{ item.name }}</td>
                    <td>{{ item.locale }}</td>
                    <td>
                        {% if loop.first == false %}
                            <a href="{{ path('admin_locale_move_up', {id : item.id}) }}"
                               class="btn btn-default btn-xs" data-toggle="tooltip" title="Remonter la locale"><i
                                        class="fa fa-2x fa-arrow-up" aria-hidden="true"></i></a>
                        {% endif %}
                        {% if loop.last == false %}
                            <a href="{{ path('admin_locale_move_down', {id : item.id}) }}"
                               class=" btn btn-default btn-xs" data-toggle="tooltip" title="Descendre la locale"><i
                                        class="fa fa-2x fa-arrow-down" aria-hidden="true"></i></a>
                        {% endif %}
                    </td>
                    <td>
                        <a href="{{ path('admin_locale_edit', { id: item.id}) }}" class="btn btn-info btn-xs"
                           data-title="Editer la langue"><i
                                    class="fas fa-edit fa-2x" aria-hidden="true"></i></a>
                        <a href="{{ path('admin_locale_delete', { id: item.id }) }}"
                           class="confirm-deletable btn btn-danger btn-xs"
                           data-title="Supprimer la langue {{ item.name }}"><i class="fa fa-2x fa-trash"
                                                                              aria-hidden="true"></i></a>
                    </td>
                </tr>
            {% endfor %}

            </tbody>
        </table>
    </div>
{% endblock %}
