{# Creating and editing a resource. Same double duty as the booking modal: the form targets the modal itself, so an invalid submit (422) replaces it with the errors showing, and a valid one answers with HX-Redirect back to the list. #} {% extends 'htmx_modal.html.twig' %} {% block title %} {%- if resource.id -%} {{ resource.label }} bearbeiten {%- else -%} {{ resource.type.label }} hinzufügen {%- endif -%} {% endblock %} {% block content %} {{ form_start(form, { attr: { 'hx-post': form.vars.action, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML', } }) }} {{ form_errors(form) }}
{{ form_row(form.label) }} {{ form_row(form.group) }} {% if form.active is defined %} {{ form_row(form.active) }} {% endif %}
{{ form_end(form) }} {% endblock %}