sterntours/trunk/app/Resources/views/default/admin/lodgingsEditCalendar.html.twig
valentin.wacker 8240ce87f9 #1352 - Anpassungen
git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3355 f459cee4-fb09-11de-96c3-f9c5f16c3c76
2017-10-26 14:14:55 +00:00

106 lines
No EOL
5.4 KiB
Twig

<table class="table">
{% for monthIndex in 0..11 %}
<thead>
<tr>
<th colspan="7">
{{ calendar[monthIndex]['monthName'] }} {{ calendar[monthIndex]['year'] }}
</th>
</tr>
<tr>
<th>Mo</th>
<th>Di</th>
<th>Mi</th>
<th>Do</th>
<th>Fr</th>
<th>Sa</th>
<th>So</th>
</tr>
</thead>
<tbody>
{% for weekIndex in 0..5 %}
<tr>
{% for dayIndex in 0..6 %}
{# @var dayState \AppBundle\Util\CalendarDayState #}
{% set dayState = calendar[monthIndex]['data'][(weekIndex * 7) + dayIndex] %}
{% if dayState.isBookable or dayState.isReserved %}
{% if dayState.isBookable %}
<td style="background-color: green!important;">
<a href="/admin/fewo/lodgings/{{ lodging.id }}/reservations/new/{{ dayState.day < 10 ? '0':'' }}{{dayState.day}}{{ calendar[monthIndex]['monthNumber'] < 10 ? '0':'' }}{{calendar[monthIndex]['monthNumber']}}{{calendar[monthIndex]['year']}}"
style="color: #5a5a5a;"
{#class="btn btn-primary"#}
rel="nofollow"
>
{{ dayState.day }}
</a>
</td>
{% elseif dayState.isReserved %}
{% if dayState.isReservationBegin %}
{# @var prevState \AppBundle\Util\CalendarDayState #}
{% set prevState = calendar[monthIndex]['data'][(weekIndex * 7) + (dayIndex - 1)] %}
{% if prevState.day == 0 or prevState.isReservationEnd %}
<td style="background-color: red!important;">
<a href="{{ '/admin/fewo/lodgings/' ~ lodging.id ~ '/reservations/' ~ dayState.reservation.id }}"
style="color: #5a5a5a;"
rel="nofollow"
>
{{ dayState.day }}
</a>
</td>
{% else %}
<td class="calendarGradientAdminBegin">
<a href="{{ '/admin/fewo/lodgings/' ~ lodging.id ~ '/reservations/' ~ dayState.reservation.id }}"
style="color: #5a5a5a;"
rel="nofollow"
>
{{ dayState.day }}
</a>
</td>
{% endif %}
{% elseif dayState.isReservationEnd %}
{# @var nextState \AppBundle\Util\CalendarDayState #}
{% set nextState = calendar[monthIndex]['data'][(weekIndex * 7) + (dayIndex + 1)] %}
{% if nextState.isReservationBegin %}
<td style="background-color: red!important;">
<a href="{{ '/admin/fewo/lodgings/' ~ lodging.id ~ '/reservations/' ~ dayState.reservation.id }}"
style="color: #5a5a5a;"
rel="nofollow"
>
{{ dayState.day }}
</a>
</td>
{% else %}
<td class="calendarGradientAdminEnd">
<a href="/admin/fewo/lodgings/{{ lodging.id }}/reservations/new/{{ dayState.day < 10 ? '0':'' }}{{dayState.day}}{{ calendar[monthIndex]['monthNumber'] < 10 ? '0':'' }}{{calendar[monthIndex]['monthNumber']}}{{calendar[monthIndex]['year']}}"
style="color: #5a5a5a;"
rel="nofollow"
>
{{ dayState.day }}
</a>
</td>
{% endif %}
{% else %}
<td style="background-color: red!important;">
<a href="{{ '/admin/fewo/lodgings/' ~ lodging.id ~ '/reservations/' ~ dayState.reservation.id }}"
style="color: #5a5a5a;"
rel="nofollow"
>
{{ dayState.day }}
</a>
</td>
{% endif %}
{% endif %}
{% else %}
{% if dayState.day == 0 %}
<td>
-
</td>
{% else %}
<td>{{ dayState.day }}</td>
{% endif %}
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
{% endfor %}
</table>