<form method="post" class="ajax" action="{{ path('course_template_proposals_time_update', { 'id': course.id, 'timeId': time.id }) }}">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Termin-Vorlage bearbeiten</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
{% if time.getAvailability() == 'Booked' %}
<div class="modal-body">
<b>{{ time.getOrderItem().owner.orderItem[0].name }}<br></b>
<small> {{ time.start|date('d.m.Y H:i') }} - {{ time.end|date('H:i') }}</small>
<p>Diese Zeit wurde reserviert oder gebucht.</p>
<a class="btn btn-primary"
href="{{ path('order_show', {
'id': time.getOrderItem().owner.orderItem|last.order.id,
'occurrenceId': time.getOccurrence().getId()
}) }}">
Reservierung/Buchung aufrufen
</a>
</div>
{% else %}
<div class="modal-body">
<div class="form-group">
<label for="availability">Status</label>
<select class="form-control" id="availability" name="availability">
<option {% if time.getAvailability() == "Bookable" %}selected{% endif %} value="Bookable">Buchung möglich</option>
<option {% if time.getAvailability() == "Requestable" %}selected{% endif %} value="Requestable">Anfrage möglich</option>
<option {% if time.getAvailability() == "NotAvailable" %}selected{% endif %} value="NotAvailable">nicht verfügbar</option>
</select>
</div>
<div class="form-group">
<label for="note">Notiz</label>
<textarea class="form-control" name="note" id="note" placeholder="Notiz">{{ time.getNote() }}</textarea>
</div>
</div>
<div class="modal-footer">
<!--
{% if app.user.role == 'ROLE_ADMIN' %}
<a href="{{ path('course-templates_convert', { 'courseId': course.id, 'timeId': time.id }) }}" class="btn btn-info mr-auto">Buchung erstellen</a>
{% endif %}
-->
<button type="submit" class="btn btn-success">Speichern</button>
</div>
{% endif %}
</form>
<div class="modal-footer">
{% if time.getAvailability() != 'Bookable' %}
<form method="post"
action="{{ path('course_template_proposals_time_unbook', { 'id': course.id, 'timeId': time.id }) }}"
class="ajax-form"
data-debug="ajax-form">
<button type="submit" class="btn btn-danger btn-sm">
Reservierung/Buchung freigeben
</button>
</form>
{% endif %}
<div id="ajax-feedback" class="alert" style="display: none;"></div>
</div>