feat: cap rooms sharing a contingent per booking

This commit is contained in:
fromme committed 2026-11-11 16:35:49 +01:00
1 parent 5942ecf340
commit 3d94505e8d
18 files changed
+671 -19

No files matched your search

+9 -3
View File
@@ -2,7 +2,7 @@
{% set htmx_change_trigger = 'change delay:300ms' %}
{% macro stepFormField(form) %}
{% macro stepFormField(form, roomId, pool = null) %}
<div class="grid grid-cols-3 pb-2">
<div class="col-span-2 pr-2">
<div class="font-semibold">
@@ -13,6 +13,12 @@
{{ form.vars.label_price_amount|format_currency('EUR') }} pro Person
{% endif %}
</div>
{% if pool is not null %}
<div class="text-sm text-gray-500">
Teilt sich das Kontingent mit: {{ pool.rooms|filter((room, id) => id != roomId)|map(room => room.label)|join(', ') }}
(zusammen noch {{ pool.available }} verfügbar)
</div>
{% endif %}
</div>
<div>
{{ form_row(form, {
@@ -70,7 +76,7 @@
Zimmer
</h3>
{% for roomId, room in bookingCreateContext.groupedRooms.byRoom %}
{{ _self.stepFormField(form.roomSelections[roomId]) }}
{{ _self.stepFormField(form.roomSelections[roomId], roomId, bookingCreateContext.roomContingentPools[roomId] ?? null) }}
{% endfor %}
{% endif %}
{% if bookingCreateContext.groupedRooms.byPax is not empty %}
@@ -78,7 +84,7 @@
Betten
</h3>
{% for roomId, room in bookingCreateContext.groupedRooms.byPax %}
{{ _self.stepFormField(form.roomSelections[roomId]) }}
{{ _self.stepFormField(form.roomSelections[roomId], roomId, bookingCreateContext.roomContingentPools[roomId] ?? null) }}
{% endfor %}
{% endif %}
</div>