<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" data-namespace-typo3-fluid="true">

  <div class="tx-ig-reservations">
    <div class="reservations-event-show">
      <div class="csc-header ce-header csc-header-layout2">
        <h2>{event.startDate->f:format.date(format: 'd.m.Y')} - {event.timeslot.name} <f:link.action class="button" title="Kalender ansehen" pluginName="PublicCalendar" controller="Calendar" action="show" pageUid="{event.calendar.pageUid}" arguments="{search: {date: '{event.startDate->f:format.date(format: \'Y-m-d\')}' }}"><core:icon identifier="actions-calendar" size="small" alternativeMarkupIdentifier="inline" /></f:link.action></h2>
        <f:if condition="{event.category}">
          <span class="subtitle">{event.category.name}</span>

        </f:if>
      </div>
      <div class="ym-grid">
	<div class="ym-g50 frame-space-after-small">
	  <div class="event-information">
            <f:if condition="{event.bookingType}">
                Art: {event.bookingType.name}<br />
            </f:if>
            Status: {event.status.name}
            <br />
            <f:if condition="{event.name}">
              <f:translate key="tx_igreservations_domain_model_event.purpose" />: {event.name}
              <br />
            </f:if>
            <f:if condition="{event.numParticipants}">
              <f:translate key="tx_igreservations_domain_model_event.num_participants" />: <b>{event.numParticipants}</b>
              <br />
            </f:if>
	  </div>
          <f:link.email email="{settings.coordinationPersonMail}">
            <f:translate key="events.mail_to_coordination_person" />
          </f:link.email>

	</div>
	<div class="ym-g50 frame-space-after-small">
	  <div class="event-data">
            <f:for each="{event.reservations}" as="reservation">
              <div class="address-data">
                <h4>
                  <f:translate key="tx_igreservations_domain_model_address" />
                </h4>
                <f:translate key="tx_igreservations_domain_model_address.salutation.{reservation.salutation}" /> {reservation.firstName} {reservation.lastName}<br />
                <f:if condition="{reservation.company}">
                  {reservation.company}<br />
                </f:if>
                {reservation.address}<br />
                {reservation.zip} {reservation.city}<br />
                <f:link.email email="{reservation.email}" /><br />
                <f:if condition="{reservation.phone}">
                  {reservation.phone}
                </f:if>
              </div>
            </f:for>
	  </div>
	</div>
	<div class="ym-g100">
	  <f:if condition="{event.notes}">
            <div class="event-notes frame-space-after-small">
              <h4>
                <f:translate key="tx_igreservations_domain_model_event.notes" />
              </h4>
              <p>{event.notes->f:format.nl2br()}</p>
            </div>
	  </f:if>
      <div class="container-button ym-g100 frame-space-after-small">
          <span>
            <f:if condition="{event.owner}">
  		    Hauptverantwortlich: <b>{event.owner.firstName} {event.owner.lastName}</b>
  		  </f:if>
            <f:if condition="{event.teammembers}">
                <f:if condition="{event.owner}"><br /></f:if>
                Teammitglieder: <b><f:for each="{event.teammembers}" as="teammember" iteration="it"><f:if condition="!{it.isFirst}">, </f:if>{teammember.firstName} {teammember.lastName}</f:for></b>
            </f:if>
            <f:if condition="{event.additionalMember}">
                <f:if condition="{event.owner} || {event.teammembers}"><br /></f:if>
              Zusätzliches Mitglied: <b>{event.additionalMember.firstName} {event.additionalMember.lastName}</b>
            </f:if>
		    </span>
      </div>
	</div>
      </div>

      <div class="show-buttons-line frame-space-before-medium">
          <div class="frame-space-after-small">
                <f:for each="{event.reservations}" as="reservation">
                  <f:link.action pageUid="{settings.unapprovedListPageUid}" action="edit" controller="Reservation" arguments="{reservation: reservation}" class="link-button">
                    <core:icon identifier="actions-open" size="small" alternativeMarkupIdentifier="inline" /> <f:translate key="events.edit" />
                  </f:link.action>
                  <br />
                </f:for>
          </div>
	<f:if condition="1 ||{showAssignLinks}">

	  <f:comment><f:if condition="!{event.teammember}">
            <f:then>
	      <div class="container-button">
                <f:link.action pageUid="{settings.unapprovedListPageUid}" pluginName="EventTodo" controller="Event" action="approve" controller="Event" arguments="{event: event}" class="link-button">
                  <core:icon identifier="actions-user" size="small" alternativeMarkupIdentifier="inline" /> <f:translate key="events.approve" />
                </f:link.action>
	      </div>
            </f:then>
            <f:else>
	      <div class="container-button">
		<span>
		  <f:if condition="{user.uid} == {event.teammember.uid}">&nbsp;<f:link.action pageUid="{settings.unapprovedListPageUid}" pluginName="EventTodo" controller="Event" action="unapprove" arguments="{event: event}" class="link-button"><core:icon identifier="actions-delete" size="small" alternativeMarkupIdentifier="inline" /> Meine Zuweisung löschen</f:link.action>
                  </f:if>
                </span>
	      </div>
            </f:else>
          </f:if></f:comment>


	  <div class="container-button">
            <f:security.ifHasRole role="reservations-admin">
              <f:link.action pageUid="{settings.unapprovedListPageUid}" pluginName="EventTodo" controller="Event" action="assignUser" controller="Event" arguments="{event: event}" class="link-button">
                <core:icon identifier="actions-user" size="small" alternativeMarkupIdentifier="inline" /> <f:translate key="events.assign_user" />
              </f:link.action>
            </f:security.ifHasRole>
	  </div>
        </f:if>
      </div>


    </div>
  </div>

</html>
