<html
    xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
    xmlns:cal="http://typo3.org/ns/Ig/IgReservations/ViewHelpers"
    xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
    xmlns:dp="http://typo3.org/ns/Internetgalerie/IgDatapoolFe/ViewHelpers"
    data-namespace-typo3-fluid="true">
    <div>
        <f:if condition="{calendar.isDateTimeMode}">
            <f:then>
                <dp:form.hiddenDate property="startDate" value="{eventStartDate}" />
                <dp:form.hiddenDate property="endDate" value="{eventEndDate}" />
                <f:form.hidden property="startTime" value="{eventStartDate->f:format.date(format: '%H:%M:%S')}" />
            </f:then>
            <f:else>
                <f:form.hidden property="timeslot" value="{timeslot.uid}" />
            </f:else>
        </f:if>
        <f:form.hidden property="calendar" value="{calendar.uid}" />
        <f:form.hidden name="date" value="{date->f:format.date(format: 'Y-m-d')}" />
        <f:form.hidden name="startDate" value="{startDate}" />
        <f:form.hidden name="startTime" value="{startTime}" />
        <f:form.hidden name="endDate" value="{endDate}" />
        <f:form.hidden name="endTime" value="{endTime}" />
        <f:form.hidden name="calendar" value="{calendar.uid}" />
        <f:form.hidden property="status" value="{defaultStatus.uid}" />
    </div>
    <f:if condition="{possibleEndTimes}">
        <div class="ym-g100 ig-inline fancyInput">
            <div class="selectIeFix">
                <f:form.select errorClass="error" property="endTime" options="{possibleEndTimes}" optionLabelField="name" value="{eventEndDate->f:format.date(format: '%H:%M:%S')}" />
            </div>
        </div>
    </f:if>
    <f:if condition="{bookingTypes}">
        <div class="ym-g100 ig-inline">
            <div class="ig-radio">
                <f:for each="{bookingTypes}" as="bookingType">
                    <div class="radioInline ig-inline">
                        <f:form.radio id="bookingTypeRequest-{bookingType.uid}" errorClass="error" property="bookingType" value="{bookingType}"
                            checked="{f:if(condition: '(!{event.bookingType} && {bookingType.isDefault}) || {event.bookingType.uid} == {bookingType.uid}', then: 'true')}" />
                        <label for="bookingTypeRequest-{bookingType.uid}" class="control-label">
                            <span>{bookingType.name}</span>
                        </label>
                    </div>
                </f:for>
            </div>
        </div>
    </f:if>
    <f:if condition="{categories}">
        <div class="ym-g100 ig-inline fancyInput">
            <div class="selectIeFix">
                <f:form.select errorClass="error" property="category" required="true" options="{categories}" optionLabelField="name" prependOptionLabel="{f:translate(key: 'tx_igreservations_domain_model_event.category')} *"
                    prependOptionValue="" />
            </div>
        </div>
    </f:if>
    <f:if condition="{calendar.calendarType.partial} == 'FullCalendar'">
        <div class="ym-g100 ig-inline fancyInput">
            <f:form.textfield id="name" class="fancyElement address-field form-control" errorClass="error" property="name" required="true" placeholder=" " />
            <label for="name" class="control-label">
                <f:translate key="tx_igreservations_domain_model_event.purpose" /> *
            </label>
        </div>
    </f:if>
    <div class="ym-g100 ig-inline fancyInput">
        <f:form.textarea id="notes" class="fancyElement form-control" errorClass="error" property="notes" placeholder=" " />
        <label for="notes" class="control-label">
            <f:translate key="tx_igreservations_domain_model_event.notes" />
        </label>
    </div>
</html>
