git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3356 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
8240ce87f9
commit
3bb0bb53a7
11 changed files with 276 additions and 330 deletions
|
|
@ -22,83 +22,42 @@
|
|||
{% 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 %}
|
||||
|
||||
{% 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 = 'admin-calendar-day-reservation' %}
|
||||
{% elseif dayState.isReservationBegin %}
|
||||
{% set cell_class = 'admin-calendar-day-reservation-begin' %}
|
||||
{% elseif dayState.isReservationEnd %}
|
||||
{% set cell_class = 'admin-calendar-day-reservation-end' %}
|
||||
{% elseif dayState.isInSeason %}
|
||||
{% set cell_class = 'admin-calendar-day-free' %}
|
||||
{% else %}
|
||||
{% if dayState.day == 0 %}
|
||||
<td>
|
||||
-
|
||||
</td>
|
||||
{% else %}
|
||||
<td>{{ dayState.day }}</td>
|
||||
{% endif %}
|
||||
{% set cell_class = '' %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<td class="{{ cell_class }}">
|
||||
{% if dayState.isReserved and not dayState.isReservationEnd %}
|
||||
<a href="{{ '/admin/fewo/lodgings/' ~ lodging.id ~ '/reservations/' ~ dayState.reservation.id }}">
|
||||
{{ dayState.day }}
|
||||
</a>
|
||||
{% elseif dayState.isBookable and not is_past_date %}
|
||||
<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']}}">
|
||||
{{ dayState.day }}
|
||||
</a>
|
||||
{% elseif dayState.day == 0 %}
|
||||
-
|
||||
{% else %}
|
||||
<del>{{ dayState.day }}</del>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -1,97 +1,65 @@
|
|||
{% for monthIndex in 0..11 %}
|
||||
{% if monthIndex is even %}
|
||||
<table class="table calendarEven">
|
||||
{% else %}
|
||||
<table class="table calendarOdd">
|
||||
{% endif %}
|
||||
<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>
|
||||
<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"
|
||||
>
|
||||
{{ 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: darkgray!important;">
|
||||
<del>{{ dayState.day }}</del>
|
||||
</td>
|
||||
{% else %}
|
||||
<td class="calendarGradientTravelBegin">
|
||||
<del>{{ dayState.day }}</del>
|
||||
</td>
|
||||
{% endif %}
|
||||
<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 %}
|
||||
{# @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>
|
||||
{% 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="/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"
|
||||
>
|
||||
{{ dayState.day }}
|
||||
</a>
|
||||
{% elseif dayState.day == 0 %}
|
||||
-
|
||||
{% 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>
|
||||
<del>{{ dayState.day }}</del>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<td style="background-color: darkgray!important;">
|
||||
<del>{{ dayState.day }}</del>
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if dayState.day == 0 %}
|
||||
<td>
|
||||
-
|
||||
</td>
|
||||
{% else %}
|
||||
{% 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>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
|
@ -205,13 +205,17 @@
|
|||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Buchung</h3>
|
||||
{% include 'default/pages/cms/calendarLodgingProgram.html.twig' %}
|
||||
{% else %}
|
||||
Momentan sind für dieses Programm keine Termine verfügbar.
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<h3>Buchung</h3>
|
||||
|
||||
<p>Bitte klicken Sie einen Anreisetermin, um zur Buchungsmaske zu gelagen.</p>
|
||||
|
||||
{% include 'default/pages/cms/calendarLodgingProgram.html.twig' %}
|
||||
|
||||
</div> <!-- END tabpanel -->
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -71,6 +71,6 @@ services:
|
|||
- { name: doctrine.event_listener, event: preRemove }
|
||||
|
||||
app.lodging_calendar_util:
|
||||
class: AppBundle\Util\LodgingCalendarUtil
|
||||
class: AppBundle\Service\LodgingCalendarService
|
||||
arguments:
|
||||
- '@doctrine.orm.entity_manager'
|
||||
Loading…
Add table
Add a link
Reference in a new issue