67 lines
3.6 KiB
Twig
67 lines
3.6 KiB
Twig
{% set weekdays = ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'] %}
|
|
{% set rows = [
|
|
{label: 'Preis', key: 'hasPrice', color: 'bg-brand-mid', legend: 'Preiskonfigurationen'},
|
|
{label: 'Verpfl.', key: 'hasBoard', color: 'bg-emerald-600', legend: 'Verpflegungsleistungen'},
|
|
{label: 'Zusatzl.', key: 'hasAdditional', color: 'bg-amber-500', legend: 'optionale Zusatzleistungen'},
|
|
{label: 'n. v.', key: 'isBlocked', color: 'bg-red-700', legend: 'nicht verfügbar'},
|
|
] %}
|
|
<div class="divide-y divide-line">
|
|
{% for month in months %}
|
|
{% set totalCols = month.firstDow + (month.days | length) %}
|
|
<div class="px-5 py-4">
|
|
<h3 class="mb-2 text-xs font-bold uppercase tracking-wide text-brand">{{ month.label }}</h3>
|
|
<div class="overflow-x-auto">
|
|
<div class="w-max">
|
|
<div class="flex">
|
|
<div class="w-20 shrink-0"></div>
|
|
{% for col in 0..(totalCols - 1) %}
|
|
{% set dow = col % 7 %}
|
|
<div class="w-6 text-center">
|
|
<span class="block text-[10px] leading-4 {{ dow >= 5 ? 'font-bold text-red-700' : 'text-muted' }}">{{ weekdays[dow] }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
<div class="mb-1 flex">
|
|
<div class="w-20 shrink-0"></div>
|
|
{% if month.firstDow > 0 %}
|
|
{% for i in 1..month.firstDow %}
|
|
<div class="w-6"></div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% for dayNum, day in month.days %}
|
|
<div class="w-6 text-center">
|
|
<span class="{{ html_classes('mx-auto block w-5 cursor-default text-xs leading-5', {'bg-brand font-bold text-white': day.isToday, 'text-ink': not day.isToday}) }}"
|
|
{% if day.isToday %}title="heute"{% endif %}
|
|
{% if day.tooltip %}{{ stimulus_controller('tooltip', {'content': day.tooltip}) }}{% endif %}
|
|
>{{ dayNum }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% for row in rows %}
|
|
<div class="mt-0.5 flex items-center">
|
|
<div class="w-20 shrink-0 text-xs text-muted">{{ row.label }}</div>
|
|
{% if month.firstDow > 0 %}
|
|
{% for i in 1..month.firstDow %}
|
|
<div class="w-6 px-px"><div class="h-3"></div></div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% for dayNum, day in month.days %}
|
|
<div class="w-6 px-px">
|
|
<div class="h-3 {{ attribute(day, row.key) ? row.color : 'bg-page' }}"></div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
<div class="flex flex-wrap gap-x-6 gap-y-2 border-t border-line px-5 py-3 text-xs text-muted">
|
|
{% for row in rows %}
|
|
<div class="flex items-center gap-1.5">
|
|
<span class="inline-block h-3 w-4 {{ row.color }}" aria-hidden="true"></span> {{ row.legend }}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|