<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 id="tx-ig-reservations-ajax-calendar-{calendar.uid}-frontend-user" style="display: none;">
	<div class="tx-ig-reservations input-form-guest">
        <header class="csc-header ce-header csc-header-layout3 frame-space-after-extra-small">
		<h3 class="guest-header">Reservierung für <span class="set-dateDay">
				<f:if condition="{date}">
					<f:format.date format="%A">{date}</f:format.date>
				</f:if>
			</span> <span class="set-dateFormat">
				<f:if condition="{date}">
					<f:format.date format="%d.%m.%Y">{date}</f:format.date>
				</f:if>
			</span></h3>
        </header>
		<cal:calendar.isAdmin calendar="{calendar}">
			<f:then>
				<f:form pluginName="Ajax" controller="Ajax" action="assignTeammember" name="event" object="{event}" pageType="9190501" class="dp-form form-kontakt form-guest">
                    <div class="ym-grid">
                        <div class="ym-g100 ig-inline frame-space-after-small">
        					<div class="columns form-group">
                                <p>{f:translate(key: 'tx_igreservations_domain_model_event.owner')}</p>
        						<f:form.select property="owner" class="form-control select2">
        							<option value=""></option>
        							<f:for each="{users}" as="user">
        								<f:form.select.option value="{user.uid}" selected="{f:if(condition: '{event.owner.uid} == {user.uid}', then: 'true')}">{user.lastName} {user.firstName} ({user.username})</f:form.select.option>
        							</f:for>
        						</f:form.select>
        					</div>
                        </div>
						<div class="ym-g100 ig-inline">
							<p>Teammitglieder zuweisen</p>
							<dp:form.multiselect property="teammembers" options="{users}" optionLabelField="usernameAndName" sorting="1" />
						</div>
                        <div class="ym-g100 ig-inline">
        					<f:form.hidden name="calendar" value="{calendar.uid}" />
        					<f:form.hidden name="timeslot" value="{timeslot.uid}" />
        					<f:form.hidden name="date" value="{dateValue}" />
        					<f:form.hidden name="command" value="assignTeammember" />
        					<f:form.submit value="{f:translate(key: 'events.assign_user')}" />
                        </div>
                    </div>
				</f:form>
			</f:then>
			<f:else>
				<div>
					<f:if condition="!{event.teammember} || {event.teammember.uid} == {feUser.uid}">
						<f:then>
							<f:form pluginName="Ajax" controller="Ajax" action="assignTeammember" name="event" object="{event}" pageType="9190501" class="form-kontakt form-guest">
                                <div class="ym-grid">
                                    <div class="ym-g100 ig-inline">
                                        <div class="columns form-group">
        									<f:form.select property="teammember" class="form-control select2">
        										<option value="">Teammitglied Auswählen</option>
        										<f:form.select.option value="{feUser.uid}" selected="{f:if(condition: '{event.teammember.uid} == {feUser.uid}', then: 'true')}">{feUser.lastName} {feUser.firstName} ({feUser.username})</f:form.select.option>
        									</f:form.select>
        								</div>
                                    </div>
                                </div>
                                <div class="ym-g100 ig-inline">
    								<f:form.hidden name="calendar" value="{calendar.uid}" />
    								<f:form.hidden name="timeslot" value="{timeslot.uid}" />
    								<f:form.hidden name="date" value="{dateValue}" />
    								<f:form.hidden name="command" value="assignTeammember" />
    								<f:form.submit value="{f:translate(key: 'events.assign_user')}" />
                                </div>
							</f:form>
						</f:then>
						<f:else>
							<p>{event.teammember.lastName} {event.teammember.firstName} ({event.teammember.username})</p>
						</f:else>
					</f:if>
				</div>
			</f:else>
		</cal:calendar.isAdmin>
	</div>
</div>
</html>
