Files
myep/templates/admin/accommodation_booking/modal_period.html.twig
T
2026-09-30 18:06:20 +02:00

58 lines
2.1 KiB
Twig

{% extends 'htmx_modal_admin.html.twig' %}
{% form_theme form 'forms_admin.html.twig' %}
{% macro line_row(line) %}
<div class="flex items-start gap-2" data-form-collection-target="field">
<div class="flex-1">{{ form_row(line.label) }}</div>
<div class="w-40">{{ form_row(line.amount) }}</div>
<button type="button"
class="mt-9 text-gray-500 hover:text-red-500"
data-action="form-collection#removeItem"
title="Position entfernen">
{{ icon('close', 'w-5 h-5') }}
</button>
</div>
{% endmacro %}
{% block content %}
{% import _self as period %}
<div class="text-xl font-bold pb-4">
{{ title }}
</div>
<p class="text-sm text-gray-500 pb-4">
Die Nächte werden vom Zeitraum der Gruppe abgezogen, der neu berechnet wird. Die Positionen
kommen zum Gesamtpreis hinzu und fallen nur unter den Rabatt auf den Gesamtpreis.
</p>
{{ form_start(form) }}
{{ form_errors(form) }}
<div class="pb-4">
{{ form_row(form.label) }}
</div>
<div class="w-40 pb-4">
{{ form_row(form.nights) }}
</div>
{% set prototype %}{{ period.line_row(form.lines.vars.prototype) }}{% endset %}
<div {{ stimulus_controller('form-collection', { prototype: prototype|json_encode }) }}>
<div class="font-bold pb-2">Positionen</div>
{{ form_errors(form.lines) }}
<div class="space-y-2" data-form-collection-target="fields">
{% for line in form.lines %}
{{ period.line_row(line) }}
{% endfor %}
</div>
<button type="button"
class="button button--secondary button--small mt-2"
data-action="form-collection#addItem">
Position hinzufügen
</button>
</div>
{% do form.lines.setRendered %}
<div class="flex justify-end pt-8">
<button type="submit" class="button button--primary button--small">
speichern
</button>
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
{% endblock %}