#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

@ -1,100 +1,106 @@
<table class="table">
{% for month in calendar %}
<thead>
{% 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>
<th colspan="7">
{{ month['monthName'] }} {{ month['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 %}
{% set day = month['data'][(weekIndex * 7) + dayIndex]|split(',') %}
{% if day|length > 1 %}
{% if day[1] == 'reservable' %}
<td style="background-color: green!important;">
<a href="/admin/fewo/lodgings/{{ lodging.id }}/reservations/new/{{ day[0] < 10 ? '0':'' }}{{day[0]}}{{ month['monthNumber'] < 10 ? '0':'' }}{{month['monthNumber']}}{{month['year']}}"
{% 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;"
{#class="btn btn-primary"#}
rel="nofollow"
>
{{ day[0] }}
{{ dayState.day }}
</a>
</td>
{% else %}
{% if day|length > 3%}
<td style="background-color: red!important;">
<a href="{{ '/admin/fewo/lodgings/' ~ lodging.id ~ '/reservations/' ~ day[1] }}"
style="color: #5a5a5a;"
{#class="btn btn-primary"#}
rel="nofollow"
>
{{ day[0] }}
</a>
</td>
{% elseif day|length > 2 and day[2] == 'from' %}
<td style="
background: -webkit-gradient(linear, left top, right bottom, color-stop(1%, #f2f2f2), color-stop(52%, #f2f2f2), color-stop(52%, red), color-stop(52%, red), color-stop(100%, red));
background: -moz-gradient(linear, left top, right bottom, color-stop(1%, #f2f2f2), color-stop(52%, #f2f2f2), color-stop(52%, red), color-stop(52%, red), color-stop(100%, red));
background: -o-gradient(linear, left top, right bottom, color-stop(1%, #f2f2f2), color-stop(52%, #f2f2f2), color-stop(52%, red), color-stop(52%, red), color-stop(100%, red));
background: gradient(linear, left top, right bottom, color-stop(1%, #f2f2f2), color-stop(52%, #f2f2f2), color-stop(52%, red), color-stop(52%, red), color-stop(100%, red));
">
<a href="{{ '/admin/fewo/lodgings/' ~ lodging.id ~ '/reservations/' ~ day[1] }}"
style="color: #5a5a5a;"
rel="nofollow"
>
{{ day[0] }}
</a>
</td>
{% elseif day|length > 2 and day[2] == 'to' %}
<td style="
background: -webkit-gradient(linear, left top, right bottom, color-stop(1%, red), color-stop(52%, red), color-stop(52%, green), color-stop(52%, green), color-stop(100%, green));
background: -moz-gradient(linear, left top, right bottom, color-stop(1%, red), color-stop(52%, red), color-stop(52%, green), color-stop(52%, green), color-stop(100%, green));
background: -o-gradient(linear, left top, right bottom, color-stop(1%, red), color-stop(52%, red), color-stop(52%, green), color-stop(52%, green), color-stop(100%, green));
background: gradient(linear, left top, right bottom, color-stop(1%, red), color-stop(52%, red), color-stop(52%, green), color-stop(52%, green), color-stop(100%, green));
">
<a href="/admin/fewo/lodgings/{{ lodging.id }}/reservations/new/{{ day[0] < 10 ? '0':'' }}{{day[0]}}{{ month['monthNumber'] < 10 ? '0':'' }}{{month['monthNumber']}}{{month['year']}}"
style="color: #5a5a5a;"
rel="nofollow"
>
{{ day[0] }}
</a>
</td>
{% else %}
<td style="background-color: red!important;">
<a href="{{ '/admin/fewo/lodgings/' ~ lodging.id ~ '/reservations/' ~ day[1] }}"
style="color: #5a5a5a;"
rel="nofollow"
>
{{ day[0] }}
</a>
</td>
{% endif %}
{% endif %}
{% else %}
<td>
{% if day[0] == 0 %}
-
{% else %}
{{ day[0] }}
{% endif %}
</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
{% else %}
{% if dayState.day == 0 %}
<td>
-
</td>
{% else %}
<td>{{ dayState.day }}</td>
{% endif %}
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</table>
</tbody>
{% endfor %}
</table>