git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3358 f459cee4-fb09-11de-96c3-f9c5f16c3c76
65 lines
No EOL
3.1 KiB
Twig
65 lines
No EOL
3.1 KiB
Twig
<div class="row">
|
|
{% for monthIndex in 0..11 %}
|
|
<div class="col-xs-12 col-sm-6">
|
|
<table class="table calendar-table">
|
|
<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] %}
|
|
|
|
{% set is_past_date = dayState.date is not empty and date(dayState.date) < date('now') %}
|
|
|
|
{# Set cell class #}
|
|
{% if is_past_date or
|
|
(dayState.isReserved and not dayState.isReservationBegin and not dayState.isReservationEnd) or
|
|
not dayState.isInSeason
|
|
%}
|
|
{% set cell_class = 'calendar-day-disabled' %}
|
|
{% elseif dayState.isReservationBegin %}
|
|
{% set cell_class = 'calendar-day-reservation-begin' %}
|
|
{% elseif dayState.isReservationEnd %}
|
|
{% set cell_class = 'calendar-day-reservation-end' %}
|
|
{% else %}
|
|
{% set cell_class = '' %}
|
|
{% endif %}
|
|
|
|
<td class="{{ cell_class }}">
|
|
{% if dayState.isBookable and not is_past_date %}
|
|
<a href="{{ page.urlPath }}/buchen?pnr={{ dayState.price.id }}&fd={{ dayState.day < 10 ? '0':'' }}{{dayState.day}}{{ calendar[monthIndex]['monthNumber'] < 10 ? '0':'' }}{{calendar[monthIndex]['monthNumber']}}{{calendar[monthIndex]['year']}}"
|
|
style="color: #80B176;"
|
|
rel="nofollow"
|
|
>
|
|
{{ dayState.day }}
|
|
</a>
|
|
{% elseif dayState.day == 0 %}
|
|
-
|
|
{% else %}
|
|
<del>{{ dayState.day }}</del>
|
|
{% endif %}
|
|
</td>
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endfor %}
|
|
</div> |