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

{% block content %}
    <div class="panel panel-default">
        <div class="panel-heading">
            Les saisons
            {% if is_granted('ROLE_ADMIN') %}
                <div class="pull-right">
                    <div class="btn-group">
                        <a href="{{ path('admin_season_new') }}" type="button" class="btn btn-default btn-xs">
                            Ajouter
                        </a>
                    </div>
                </div>
            {% endif %}
        </div>
        <table class="table table-striped">
            <thead>
            <tr>
                <th>#</th>
                <th>Titre</th>
                <th>Sous titre</th>
                <th>Position</th>
                <th>Action</th>
            </tr>
            </thead>
            <tbody>
            {% for item in items %}
                <tr>
                    <td>{{ item.position }}</td>
                    <td>{{ item.title }}</td>
                    <td>{{ item.subtitle }}</td>
                    <td>
                        {% if loop.first == false %}
                            <a href="{{ path('admin_season_move_up', {id : item.id}) }}"
                               class="btn btn-default btn-xs" data-toggle="tooltip" title="Remonter la saison"><i
                                        class="fa fa-2x fa-arrow-up" aria-hidden="true"></i></a>
                        {% endif %}
                        {% if loop.last == false %}
                            <a href="{{ path('admin_season_move_down', {id : item.id}) }}"
                               class=" btn btn-default btn-xs" data-toggle="tooltip" title="Descendre la saison"><i
                                        class="fa fa-2x fa-arrow-down" aria-hidden="true"></i></a>
                        {% endif %}
                    </td>
                    <td>
                        <a href=" {{ path('admin_season_edit', { id: item.id }) }} " class="btn btn-info btn-xs"
                           data-toggle="tooltip" title="Editer la saison {{ item.title }}"><i
                                    class="fas fa-edit fa-2x"></i></a>

                        <a href=" {{ path('admin_season_delete', { id: item.id }) }} "
                           class="confirm-deletable btn btn-danger btn-xs"
                           data-toggle="tooltip" title="Supprimer la saison {{ item.title }}"
                           data-title="Supprimer la saison {{ item.title }}">
                            <i class="fa fa-2x fa-trash"></i></a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}