feat: groups price calculator admin crud, booking/offer flow and api

This commit is contained in:
Björn Fromme
2026-08-03 15:25:10 +02:00
parent eabed8295a
commit 9d2aa11fdb
258 changed files with 16231 additions and 582 deletions
+11
View File
@@ -0,0 +1,11 @@
{% set variant = variant ?? 'primary' %}
{% set cva = html_cva('badge', {
variant: {
primary: 'bg-primary text-white',
success: 'bg-green-500 text-white',
warning: 'bg-red-500 text-white',
}
}, [], { variant: 'primary' }) %}
<span {{ attributes.defaults({class: cva.apply({variant: variant})}).without('variant') }}>
{{ block('content') }}
</span>
@@ -0,0 +1,71 @@
{% set weekdays = ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'] %}
<div class="space-y-4 mb-4">
{% for month in months %}
{% set totalCols = month.firstDow + (month.days | length) %}
<div>
<div class="text-sm font-semibold mb-1">{{ month.label }}</div>
<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-xs leading-none {{ dow >= 5 ? 'text-red-400' : 'text-gray-300' }}">{{ weekdays[dow] }}</span>
</div>
{% endfor %}
</div>
<div class="flex mb-0.5">
<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('block text-xs leading-none cursor-default', {'font-bold text-secondary': day.isToday, 'text-gray-500': not day.isToday}) }}"
{% if day.tooltip %}{{ stimulus_controller('tooltip', {'content': day.tooltip}) }}{% endif %}
>{{ dayNum }}</span>
</div>
{% endfor %}
</div>
{% for row in [
{label: 'Preis', key: 'hasPrice', color: 'bg-blue-500'},
{label: 'Verpfl.', key: 'hasBoard', color: 'bg-green-500'},
{label: 'Zusatzl.', key: 'hasAdditional', color: 'bg-amber-500'},
{label: 'n. v.', key: 'isBlocked', color: 'bg-red-500'},
] %}
<div class="flex items-center mt-0.5">
<div class="w-20 shrink-0 text-xs text-gray-500">{{ 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-gray-100' }}"></div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
</div>
{% endfor %}
</div>
<div class="flex flex-wrap gap-x-6 gap-y-2 mb-4 text-sm text-gray-600">
<div class="flex items-center gap-1.5">
<span class="inline-block w-4 h-3 bg-blue-500"></span> Preiskonfigurationen
</div>
<div class="flex items-center gap-1.5">
<span class="inline-block w-4 h-3 bg-green-500"></span> Verpflegungsleistungen
</div>
<div class="flex items-center gap-1.5">
<span class="inline-block w-4 h-3 bg-amber-500"></span> optionale Zusatzleistungen
</div>
<div class="flex items-center gap-1.5">
<span class="inline-block w-4 h-3 bg-red-500"></span> nicht verfügbar
</div>
</div>
@@ -0,0 +1,17 @@
<div id="calendar-wrapper">
<twig:calendar:grid :months="months"/>
<div class="flex items-center justify-between mt-4">
<button class="button button--secondary button--small"
hx-get="{{ path('app_admin_accommodation_calendar', {id: accommodation.id, month: prevMonth}) }}"
hx-target="#calendar-wrapper"
hx-swap="outerHTML">
{{ prevLabel }}
</button>
<button class="button button--secondary button--small"
hx-get="{{ path('app_admin_accommodation_calendar', {id: accommodation.id, month: nextMonth}) }}"
hx-target="#calendar-wrapper"
hx-swap="outerHTML">
{{ nextLabel }}
</button>
</div>
</div>
@@ -0,0 +1,20 @@
{% set warning = warning ?? false %}
{% set method = method ?? 'get' %}
<button type="button"
class="{{ html_classes('block px-4 py-2 text-sm w-full text-left', {
'text-red-500 hover:text-primary': warning,
'text-gray-700 hover:text-primary': not warning
}) }}"
role="menuitem"
tabindex="-1"
{{ attributes
.defaults({
'hx-target': 'body',
'hx-swap': 'beforeend',
})
.without('url', 'warning', 'method')
}}
hx-{{ method | lower }}="{{ url }}"
>
{{ block('content') }}
</button>
@@ -0,0 +1,20 @@
<div class="relative inline-block text-left group cursor-pointer">
<button type="button"
class="flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-0"
aria-expanded="true"
aria-haspopup="true">
<span class="sr-only">Funktionen</span>
{{ icon('dots', 'w-6 h-6') }}
</button>
<div class="hidden group-hover:block absolute right-0 top-0 z-10 w-56 origin-top-right pt-4"
role="menu"
aria-orientation="vertical"
aria-labelledby="menu-button"
tabindex="-1">
<div class="rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
<div class="py-1 menu menu--pulldown" role="none">
{% block content %}{% endblock %}
</div>
</div>
</div>
</div>
@@ -0,0 +1,10 @@
{% set warning = warning ?? false %}
<a href="{{ url }}"
class="{{ html_classes('block px-4 py-2 text-sm w-full', {
'text-red-500 hover:text-primary': warning,
'text-gray-700 hover:text-primary': not warning
}) }}"
role="menuitem"
tabindex="-1">
{{ block('content') }}
</a>
@@ -0,0 +1 @@
<h1 class="text-2xl font-bold pb-8">{{ block('content') }}</h1>