feat: add admin crud for resources and rooms

This commit is contained in:
fromme committed 2026-09-17 16:26:29 +02:00
1 parent ad5d5acb00
commit 3d67942c62
19 files changed
+1059 -4

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
{#
Creating and editing a desk or parking spot. 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) }}
<div class="space-y-4">
{{ form_row(form.label) }}
{{ form_row(form.group) }}
{% if form.active is defined %}
{{ form_row(form.active) }}
{% endif %}
</div>
<div class="flex justify-end gap-2 pt-6">
<button type="button" class="button button--neutral" {{ stimulus_action('modal', 'close') }}>
Abbrechen
</button>
<button type="submit" class="button button--primary">
Speichern
</button>
</div>
{{ form_end(form) }}
{% endblock %}