#1352 - Anpassungen

git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3355 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
valentin.wacker 2017-10-26 14:14:55 +00:00
parent a2d4159c88
commit 8240ce87f9
9 changed files with 670 additions and 230 deletions

View file

@ -24,57 +24,70 @@
{% for weekIndex in 0..5 %}
<tr>
{% for dayIndex in 0..6 %}
{% set day = calendar[monthIndex]['data'][(weekIndex * 7) + dayIndex]|split(',') %}
{% if day|length > 1 %}
{% if day[1] == 'reservable' %}
{# @var dayState \AppBundle\Util\CalendarDayState #}
{% set dayState = calendar[monthIndex]['data'][(weekIndex * 7) + dayIndex] %}
{% if dayState.isBookable or dayState.isReserved %}
{% if dayState.isBookable %}
<td>
<a href="/fewo/{{ page.slug }}/fewo-buchen?pnr={{ day[2] }}&fd={{ day[0] < 10 ? '0':'' }}{{day[0]}}{{ calendar[monthIndex]['monthNumber'] < 10 ? '0':'' }}{{calendar[monthIndex]['monthNumber']}}{{calendar[monthIndex]['year']}}"
<a href="/fewo/{{ page.slug }}/fewo-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: #5a5a5a;"
rel="nofollow"
>
{{ day[0] }}
{{ dayState.day }}
</a>
</td>
{% else %}
{% if day|length > 3%}
<td style="background-color: darkgray!important;">
<del>{{ day[0] }}</del>
</td>
{% elseif day|length > 2 and day[2] == 'from' %}
<td style="
background: darkgray!important;
">
<del>{{ day[0] }}</del>
</td>
{% elseif day|length > 2 and day[2] == 'to' %}
{% set nextDay = calendar[monthIndex]['data'][(weekIndex * 7) + (dayIndex + 1)]|split(',') %}
<td class="calendarGradient">
<a href="/fewo/{{ page.slug }}/fewo-buchen?pnr={{ nextDay[2] }}&fd={{ day[0] < 10 ? '0':'' }}{{day[0]}}{{ calendar[monthIndex]['monthNumber'] < 10 ? '0':'' }}{{calendar[monthIndex]['monthNumber']}}{{calendar[monthIndex]['year']}}"
style="color: white;"
rel="nofollow"
>
<del>{{ day[0] }}</del>
</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: darkgray!important;">
<del>{{ dayState.day }}</del>
</td>
{% else %}
<td class="calendarGradientTravelBegin">
<del>{{ dayState.day }}</del>
</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: darkgray!important;">
<del>{{ dayState.day }}</del>
</td>
{% else %}
<td class="calendarGradientTravelEnd">
<a href="/fewo/{{ page.slug }}/fewo-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: white;"
rel="nofollow"
>
<del>{{ dayState.day }}</del>
</a>
</td>
{% endif %}
{% else %}
<td style="background-color: darkgray!important;">
<del>{{ day[0] }}</del>
<del>{{ dayState.day }}</del>
</td>
{% endif %}
{% endif %}
{% else %}
{% if day[0] == 0 %}
{% if dayState.day == 0 %}
<td>
-
</td>
{% else %}
<td style="background-color: darkgray!important">
<del>{{ day[0] }}</del>
</td>
{% if dayState.isInSeason and not(dayState.isBookable) and not(dayState.isReserved) %}
<td>
<del>{{ dayState.day }}</del>
</td>
{% else %}
<td style="background-color: darkgray!important">
<del>{{ dayState.day }}</del>
</td>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
</tr>