<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>
  <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">
            <label for="purpose">
                <f:translate key="tx_igreservations_domain_model_event.purpose" /> *
            </label>
            <f:form.textfield id="name" class="fancyElement address-field" errorClass="error" property="event.name" required="true" />
        </div>
    </f:if>
    <div class="ym-g100 ig-inline fancyInput amountInput">
        <label for="numParticipants">
            <f:translate key="tx_igreservations_domain_model_event.num_participants" />
        </label>
        <f:if condition="{settings.maxParticipants} > 0">
            <f:then>
                <dp:form.spinner id="numParticipants" class="fancyElement" errorClass="error" property="event.numParticipants" min="{settings.minParticipants}" max="{settings.maxParticipants}" />
            </f:then>
            <f:else>
                <dp:form.spinner id="numParticipants" class="fancyElement" errorClass="error" property="event.numParticipants" />
            </f:else>
        </f:if>
    </div>
    <div class="ym-g100 ig-inline fancyInput">
        <div class="selectIeFix">
            <f:form.select class="address-field" 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">
        <label for="firstName">
            <f:translate key="tx_igreservations_domain_model_address.first_name" /> *
        </label>
        <f:form.textfield id="firstName" class="fancyElement address-field" errorClass="error" property="firstName" required="true" />
    </div>
    <div class="ym-g100 ig-inline fancyInput">
        <label for="lastName">
            <f:translate key="tx_igreservations_domain_model_address.last_name" /> *
        </label>
        <f:form.textfield id="lastName" class="fancyElement address-field" errorClass="error" property="lastName" required="true" />
    </div>
    <div class="ym-g100 ig-inline fancyInput">
        <label for="company">
            <f:translate key="tx_igreservations_domain_model_address.company" />
        </label>
        <f:form.textfield id="company" class="fancyElement address-field" errorClass="error" property="company" />
    </div>
    <div class="ym-g100 ig-inline fancyInput">
        <label for="address">
            <f:translate key="tx_igreservations_domain_model_address.address" /> *
        </label>
        <f:form.textfield id="address" class="fancyElement address-field" errorClass="error" property="address" required="true" />
    </div>
    <div class="ym-g100 ig-inline fancyInput">
        <label for="zip">
            <f:translate key="tx_igreservations_domain_model_address.zip" /> *
        </label>
        <f:form.textfield id="zip" class="fancyElement address-field" errorClass="error" property="zip" required="true" />
    </div>
    <div class="ym-g100 ig-inline fancyInput">
        <label for="city">
            <f:translate key="tx_igreservations_domain_model_address.city" /> *
        </label>
        <f:form.textfield id="city" class="fancyElement address-field" errorClass="error" property="city" required="true" />
    </div>
    <div class="ym-g100 ig-inline fancyInput">
        <label for="email">
            <f:translate key="tx_igreservations_domain_model_address.email" /> *
        </label>
        <f:form.textfield id="email" class="fancyElement address-field" errorClass="error" property="email" required="true" />
    </div>
    <div class="ym-g100 ig-inline fancyInput">
        <label for="phone">
            <f:translate key="tx_igreservations_domain_model_address.phone" />
        </label>
        <f:form.textfield id="phone" class="fancyElement address-field" errorClass="error" property="phone" />
    </div>
    <div class="ym-g100 ig-inline fancyInput">
        <label for="notes">
            <f:translate key="tx_igreservations_domain_model_event.notes" />
        </label>
        <f:form.textarea id="notes" class="fancyElement" errorClass="error" property="event.notes" />
    </div>
</div>

</html>
