#1423 #1441 - Ansicht der Kalender, Kalender neu auslesen und darstellen

git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3441 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
adametz 2018-08-14 15:14:56 +00:00
parent 0af86f618c
commit 0ac8127653
10 changed files with 365 additions and 73 deletions

View file

@ -25,46 +25,23 @@
{# @var dayState \AppBundle\Util\CalendarDayState #}
{% set dayState = calendar_month['data'][(weekIndex * 7) + dayIndex] %}
{% set is_past_date = dayState.date is not empty and date(dayState.date) < date('now') %}
{# Set cell class #}
{% if dayState.isReserved and (not dayState.isReservationBegin and not dayState.isReservationEnd) %}
{% set cell_class = 'calendar-day-disabled' %}
{% elseif dayState.day == 0 %}
{% set cell_class = 'calendar-day-non' %}
{% elseif is_past_date %}
{% set cell_class = 'calendar-day-past' %}
{% elseif not dayState.isInSeason %}
{% set cell_class = 'calendar-day-non' %}
{% 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_month['monthNumber'] < 10 ? '0':'' }}{{calendar_month['monthNumber']}}{{calendar_month['year']}}"
style="color: #80B176;"
rel="nofollow"
>
{{ dayState.day }}
</a>
{% elseif dayState.day == 0 %}
&nbsp;
{% elseif cell_class == '' %}
{{ dayState.day }}
{% else %}
{% if is_past_date %}
<del style="color:#989898;">{{ dayState.day }}</del>
{% else %}
{{ dayState.day }}
{% endif %}
{% endif %}
</td>
<td class="{{ dayState.getCssClass }} {% if dayState.isBookable %}active{% endif %}">
{% if dayState.isBookable %}
<a href="{{ page.urlPath }}/buchen?pnr={{ dayState.price.id }}&fd={{ dayState.day < 10 ? '0':'' }}{{dayState.day}}{{ calendar_month['monthNumber'] < 10 ? '0':'' }}{{calendar_month['monthNumber']}}{{calendar_month['year']}}"
rel="nofollow" class="table-link"
>
{{ dayState.day }}
</a>
{% elseif dayState.day == 0 %}
&nbsp;
{% else %}
{% if dayState.isPastDate %}
<del style="color:#989898;">{{ dayState.day }}</del>
{% else %}
{{ dayState.day }}
{% endif %}
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}