feat: integrate with new bpn-connect api for calendars

This commit is contained in:
Björn Fromme
2026-06-10 14:42:49 +02:00
parent 14c8783008
commit ea0f5c6b3d
8 changed files with 304 additions and 173 deletions
@@ -6,21 +6,17 @@
<f:section name="Main">
<div class="calendar__range">
<f:render section="Year" arguments="{year: yearStart, range: range, events: events, months: months, hotel: hotel}"/>
<f:if condition="{yearEnd}">
<f:render section="Year" arguments="{year: yearEnd, range: range, events: events, months: months, hotel: hotel}"/>
<f:if condition="{calendar.error}">
<div class="w-full p-4 text-sm text-red-600">
Der Kalender konnte aktuell nicht geladen werden.
</div>
</f:if>
<f:for each="{calendarMonths}" as="month">
<f:render section="Calendar" arguments="{month: month, calendar: calendar, months: months}"/>
</f:for>
</div>
</f:section>
<f:section name="Year">
<f:for each="{year}" as="month">
<ep:calendar.includes range="{range}" period="{month}">
<f:render section="Calendar" arguments="{_all}"/>
</ep:calendar.includes>
</f:for>
</f:section>
<f:section name="Calendar">
<div class="w-full{f:if(condition: '{months} > 1', then: ' md:w-1/2 lg:w-1/3')}">
<table class="min-w-full border border-zinc-400 border-collapse mb-0">
@@ -34,17 +30,27 @@
</tr>
</thead>
<tbody>
<f:for each="{month}" as="week">
<f:for each="{month.weeks}" as="week">
<tr>
<f:for each="{week}" as="day">
<td class="px-1 py-2 border border-zinc-300 text-center">
<ep:calendar.contingent day="{day}" month="{month}" events="{events}"/>
<f:if condition="{day.inMonth}">
<f:then>
<ep:calendar.contingent day="{day.date}" calendar="{calendar}"/>
</f:then>
<f:else>
&nbsp;
</f:else>
</f:if>
</td>
</f:for>
</tr>
</f:for>
</tbody>
</table>
<div class="px-2 pt-2 text-sm font-semibold text-zinc-700">
{month.label}
</div>
</div>
</f:section>