feat: rename admin screen, allow deleting a resource
This commit is contained in:
1 parent
dc1822b8cf
commit
5e5bf00f8f
7 files changed
+197
-9
No files matched your search
@@ -1,5 +1,5 @@
|
||||
{#
|
||||
Creating and editing a desk or parking spot. Same double duty as the booking modal: the form
|
||||
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.
|
||||
#}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
{% extends 'htmx_confirmation_modal.html.twig' %}
|
||||
|
||||
{% block title %}{{ resource.type.label }} löschen?{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p>
|
||||
{{ resource.type.label }} <em>{{ resource.label }}</em> wird endgültig gelöscht.
|
||||
</p>
|
||||
{% if upcoming > 0 or past > 0 %}
|
||||
<p class="pt-2" data-booking-count>
|
||||
Mit gelöscht werden {{ upcoming }} Buchungen ab heute und {{ past }} vergangene.
|
||||
Um die Buchungen zu behalten, stattdessen „nicht buchbar“ setzen.
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block button_confirm %}Löschen{% endblock %}
|
||||
@@ -3,11 +3,12 @@
|
||||
here once saved -- the same shape as the sibling apps' admin lists.
|
||||
|
||||
Retired resources stay listed, muted, because this is the only place they can be reactivated.
|
||||
Only an empty room offers "Löschen"; DeleteController refuses the rest regardless.
|
||||
Only an empty room offers "Löschen"; DeleteController refuses the rest regardless. A resource
|
||||
can always be deleted, taking its bookings with it -- the modal says how many.
|
||||
#}
|
||||
{% extends 'layout.html.twig' %}
|
||||
|
||||
{% block title %}Plätze & Räume · ephub{% endblock %}
|
||||
{% block title %}Ressourcen · ephub{% endblock %}
|
||||
|
||||
{% macro opener(url, label, variant = 'neutral') %}
|
||||
<button type="button" class="button button--small button--{{ variant }}"
|
||||
@@ -29,7 +30,10 @@
|
||||
<span class="badge bg-gray-100 text-gray-600 ml-1">nicht buchbar</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
{{ _self.opener(path('app_admin_resource_edit', { id: resource.id }), 'Bearbeiten') }}
|
||||
<div class="flex gap-2">
|
||||
{{ _self.opener(path('app_admin_resource_edit', { id: resource.id }), 'Bearbeiten') }}
|
||||
{{ _self.opener(path('app_admin_resource_delete', { id: resource.id }), 'Löschen') }}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@@ -39,7 +43,7 @@
|
||||
{% block content %}
|
||||
<a class="text-sm text-gray-500 hover:text-gray-900" href="{{ path('app_dashboard') }}">← Übersicht</a>
|
||||
|
||||
<h1 class="pt-2">Plätze & Räume</h1>
|
||||
<h1 class="pt-2">Ressourcen</h1>
|
||||
<p class="subline">Was gebucht werden kann und wo es steht.</p>
|
||||
|
||||
{% for section in sections %}
|
||||
|
||||
@@ -68,10 +68,10 @@
|
||||
class="group flex flex-col rounded-md border border-gray-200 p-6 hover:border-primary hover:bg-gray-50">
|
||||
<div class="flex items-center gap-3 pb-2">
|
||||
{{ ux_icon('lucide:layout-grid', { class: 'h-6 w-6 shrink-0 text-primary' }) }}
|
||||
<span class="text-lg font-bold">Plätze & Räume</span>
|
||||
<span class="text-lg font-bold">Ressourcen</span>
|
||||
</div>
|
||||
<p class="text-sm text-gray-500 pb-4">
|
||||
Schreibtische, Parkplätze und Räume anlegen und bearbeiten.
|
||||
Buchbare Ressourcen und ihre Standorte verwalten.
|
||||
</p>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
Reference in new issue
Block a user