{% extends 'admin.html.twig' %}
{% form_theme form 'default/form/theme.html.twig' %}

{% block body %}
    <section class="clearfix">
        <div class="content-copy">
            <h1>Neue Reservierung anlegen für {{ lodging.name }}</h1>

            <h3>Mögliche Saisons</h3>

            <table class="table">
                <thead>
                <tr>
                    <th>Name</th>
                    <th>Von</th>
                    <th>Bis</th>
                    <th>Preis pro Nacht</th>
                    <th>Service-Gebühr</th>
                </tr>
                </thead>
                <tbody>
                {% for lodgingPrice in lodging.prices %}
                    <tr>
                        <td>{{ lodgingPrice.season.name }}</td>
                        <td>{{ lodgingPrice.season.fromDate|date('d-m-y') }}</td>
                        <td>{{ lodgingPrice.season.toDate|date('d-m-y') }}</td>
                        <td>{{ lodgingPrice.perNight }}</td>
                        <td>{{ lodgingPrice.flatPrice }}</td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>

            <h3>Reservierung</h3>

            <form class="st-booking-form" method="post">

                {{ form_errors(form) }}

                <div id="message"></div>

                <div class="form-box">
                    {{ form_row(form.lodging, {label: 'Objekt'}) }}
                    {{ form_row(form.fromDate , {label: 'Von'}) }}
                    {{ form_row(form.toDate, {label: 'Bis'}) }}
                    {{ form_row(form.status, {label: 'Status'}) }}
                    {#{{ form_row(form.type, {label: 'Typ'}) }}#}

                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <button type="submit" value="SEND" id="submit"
                                class="btn btn-primary btn-lg border-radius"
                        >
                            Speichern
                        </button>
                    </div>
                </div><!-- end form-box -->
                {{ form_rest(form) }}
            </form>
            <a href="/admin/fewo/lodgings/{{ lodging.id }}"
               class="btn btn-primary"
               rel="nofollow"
            >
                Zurück
            </a>
        </div>
    </section><!-- end section -->
{% endblock body %}