{% extends 'htmx_modal_admin.html.twig' %} {% form_theme form 'forms_admin.html.twig' %} {# One line as a row of bare widgets; the column headings above name them once for all rows. Plain flex rather than an arbitrary grid template: the modal is loaded into a page whose stylesheet may predate any class used only here. #} {% macro line_row(line) %}
{{ form_widget(line.label, { attr: { placeholder: 'z. B. Übernachtung' } }) }} {{ form_errors(line.label) }}
{{ form_widget(line.amount) }} {{ form_errors(line.amount) }}
{% endmacro %} {% block content %} {% import _self as period %}
{{ title }}

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.

{{ form_start(form) }} {{ form_errors(form) }}
{{ form_row(form.label, { row_attr: { class: 'flex-1 min-w-0' } }) }} {{ form_row(form.nights, { row_attr: { class: 'w-32 shrink-0' } }) }}
{% set prototype %}{{ period.line_row(form.lines.vars.prototype) }}{% endset %}
Position
{# w-5 matches the remove button's icon, so the heading sits over the amounts. #}
Betrag
{{ form_errors(form.lines) }}
{% for line in form.lines %} {{ period.line_row(line) }} {% endfor %}
{% do form.lines.setRendered %}
{{ form_rest(form) }} {{ form_end(form) }} {% endblock %}