{% extends 'admin.html.twig' %}


{% block body %}
    <section class="clearfix">
        <div class="content-copy">
            <h1>Saisons</h1>

            <div class="table-responsive" id="no-more-tables">
                <table class="table">
                    <thead>
                    <tr>
                        <th>Name</th>
                        <th>Von</th>
                        <th>Bis</th>
                        <th>Mindestbelegung in Nächte</th>
                        <th></th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    {% if seasons is not empty %}
                        {% for season in seasons %}
                            <tr>
                                <td>{{ season.name }}</td>
                                <td>{{ season.fromDate|date('d.m.y') }}</td>
                                <td>{{ season.toDate|date('d.m.y') }}</td>
                                <td>{{ season.minimumStay }}</td>
                                <td>
                                    <a href="{{ '/admin/fewo/seasons/' ~ season.id }}"
                                       class="btn btn-primary"
                                       rel="nofollow"
                                    >
                                        Bearbeiten
                                    </a>
                                </td>
                                <td>
                                    <a href="{{ '/admin/fewo/seasons/' ~ season.id ~ '/delete' }}"
                                       class="btn btn-primary"
                                       rel="nofollow"
                                    >
                                        Löschen
                                    </a>
                                </td>
                            </tr>
                        {% endfor %}
                    {% else %}
                        <h2>Keine Saisons verfügbar</h2>
                    {% endif %}
                    <tr>
                        <td>
                            <a href="/admin/fewo/seasons/new"
                               class="btn btn-primary"
                               rel="nofollow"
                            >
                                Hinzufügen
                            </a>
                        </td>
                    </tr>

                    </tbody>
                </table>
            </div>
        </div>
    </section><!-- end section -->
{% endblock body %}