<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="event.startDate" value="{eventStartDate}" />
                <dp:form.hiddenDate property="event.endDate" value="{eventEndDate}" />
                <f:form.hidden property="event.startTime" value="{eventStartDate->f:format.date(format: '%H:%M:%S')}" />
            </f:then>
            <f:else>
                <f:form.hidden property="event.timeslot" value="{timeslot.uid}" />
            </f:else>
        </f:if>
        <f:if condition="{event.uid}">
            <f:form.hidden property="event" value="{event}" />
        </f:if>
        <f:form.hidden property="event.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="event.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="event.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">
                        <label for="bookingTypeRequest-{bookingType.uid}">
                            <f:form.radio id="bookingTypeRequest-{bookingType.uid}" errorClass="error" property="event.bookingType" value="{bookingType}"
                                    checked="{f:if(condition: '(!{event.bookingType} && {bookingType.isDefault}) || {event.bookingType.uid} == {bookingType.uid}', then: 'true')}" />
                            <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="event.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="event.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 amountInput">
            <dp:form.spinner id="numParticipants" class="fancyElement form-control" errorClass="error" property="event.numParticipants" min="{settings.minParticipants}" max="{settings.maxParticipants}" placeholder=" " />
            <label for="numParticipants" class="control-label">
                    <f:translate key="tx_igreservations_domain_model_event.num_participants" />
            </label>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
            <div class="selectIeFix">
                    <f:form.select class="address-field form-control" errorClass="error" property="salutation"
                            options="{1: '{f:translate(key: \'tx_igreservations_domain_model_address.salutation.1\')}', 2: '{f:translate(key: \'tx_igreservations_domain_model_address.salutation.2\')}'}"
                            prependOptionLabel="{f:translate(key: 'tx_igreservations_domain_model_address.salutation')} *" prependOptionValue="" required="true" />
            </div>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
            <f:form.textfield id="firstName" class="fancyElement address-field form-control" errorClass="error" property="firstName" required="true" placeholder=" " />
            <label for="firstName" class="control-label">
                    <f:translate key="tx_igreservations_domain_model_address.first_name" /> *
            </label>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
            <f:form.textfield id="lastName" class="fancyElement address-field form-control" errorClass="error" property="lastName" required="true" placeholder=" " />
            <label for="lastName" class="control-label">
                    <f:translate key="tx_igreservations_domain_model_address.last_name" /> *
            </label>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
            <f:form.textfield id="company" class="fancyElement address-field form-control" errorClass="error" property="company" placeholder=" " />
            <label for="company" class="control-label">
                    <f:translate key="tx_igreservations_domain_model_address.company" />
            </label>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
            <f:form.textfield id="address" class="fancyElement address-field form-control" errorClass="error" property="address" required="true" placeholder=" " />
            <label for="address" class="control-label">
                    <f:translate key="tx_igreservations_domain_model_address.address" /> *
            </label>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
            <f:form.textfield id="zip" class="fancyElement address-field form-control" errorClass="error" property="zip" required="true" placeholder=" " />
            <label for="zip" class="control-label">
                    <f:translate key="tx_igreservations_domain_model_address.zip" /> *
            </label>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
            <f:form.textfield id="city" class="fancyElement address-field form-control" errorClass="error" property="city" required="true" placeholder=" " />
            <label for="city" class="control-label">
                    <f:translate key="tx_igreservations_domain_model_address.city" /> *
            </label>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
            <f:form.textfield id="email" class="fancyElement address-field form-control" errorClass="error" property="email" required="true" placeholder=" " />
            <label for="email" class="control-label">
                    <f:translate key="tx_igreservations_domain_model_address.email" /> *
            </label>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
            <f:form.textfield id="phone" class="fancyElement address-field form-control" errorClass="error" property="phone" placeholder=" " />
            <label for="phone" class="control-label">
                    <f:translate key="tx_igreservations_domain_model_address.phone" />
            </label>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
            <f:form.textarea id="notes" class="fancyElement form-control" errorClass="error" property="event.notes" placeholder=" " />
            <label for="notes" class="control-label">
                    <f:translate key="tx_igreservations_domain_model_event.notes" />
            </label>
    </div>
</html>
