Files
myep/templates/admin/accommodation/index.html.twig
T

78 lines
3.0 KiB
Twig

{% extends 'layout_admin.html.twig' %}
{% block content %}
<twig:page:heading>Gruppenhäuser</twig:page:heading>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner text-sm">
<table class="data-table">
<thead>
<tr>
<th>
Name
</th>
<th>
Code
</th>
<th>
erstellt
</th>
<th>
aktualisiert
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for accommodation in accommodations %}
<tr>
<td>
<a href="{{ path('app_admin_accommodation_edit', { 'id': accommodation.id, 'r': return_url() }) }}">
{{ accommodation.name }}
</a>
</td>
<td>
{{ accommodation.calendarCode }}
</td>
<td>
{{ accommodation.createdAt | date('d.m.Y, H:i') }}
</td>
<td>
{% if accommodation.updatedAt is not null %}
{{ accommodation.updatedAt | date('d.m.Y, H:i') }}
{% else %}
-
{% endif %}
</td>
<td class="text-right">
<twig:dropdown>
<twig:dropdown:link url="{{ path('app_admin_accommodation_edit', { 'id': accommodation.id, 'r': return_url() }) }}">
bearbeiten
</twig:dropdown:link>
<twig:dropdown:hxbutton url="{{ path('app_admin_accommodation_delete', { 'id': accommodation.id, 'r': return_url() }) }}" warning>
löschen
</twig:dropdown:hxbutton>
</twig:dropdown>
</td>
</tr>
{% else %}
<tr>
<td colspan="5" class="text-center">
Keine Daten...
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="flex justify-end">
<button type="button"
hx-get="{{ path('app_admin_accommodation_create') }}"
hx-target="body"
hx-swap="beforeend"
class="button button--primary button--small">
neu
</button>
</div>
{% endblock %}