futtern/templates/food_order/index.html.twig
2025-06-18 20:12:17 +02:00

48 lines
1.6 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}FoodOrder index{% endblock %}
{% block body %}
<h1 class="mb-4">FoodOrder index</h1>
<div class="mb-3">
<button
class="btn btn-primary"
hx-get="{{ path('app_food_order_new') }}"
hx-trigger="click"
hx-target="closest div"
>Create new</button>
</div>
<hr>
<table class="table table-striped table-hover">
<thead class="table-light">
<tr>
<th>CreatedBy</th>
<th>Vendor</th>
<th>CreatedAt</th>
<th>ClosedAt</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for food_order in food_orders %}
{{ include('food_order/table_row.html.twig') }}
{% endfor %}
{% if food_orders|length < 10 %}
<tr>
<td colspan="5" class="text-center text-muted">
check the <a href="{{ path('app_food_order_archive') }}">archive</a>
for older orders
</td>
</tr>
{% endif %}
</tbody>
</table>
<div class="d-flex gap-2">
{% if prev_page > 0 %}
<a class="btn btn-outline-secondary btn-sm" href="{{ path('app_food_order_archive', {'page': prev_page}) }}">previous page</a>
{% endif %}
{% if next_page > current_page %}
<a class="btn btn-outline-secondary btn-sm" href="{{ path('app_food_order_archive', {'page': next_page}) }}">next page</a>
{% endif %}
</div>
{% endblock %}