This commit is contained in:
lubiana 2025-06-18 20:12:17 +02:00
parent c99032044d
commit 5cb66c5012
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
34 changed files with 1236 additions and 132 deletions

View file

@ -3,10 +3,12 @@
{% block title %}Edit FoodOrder{% endblock %}
{% block body %}
<h1>Edit FoodOrder</h1>
<h1 class="mb-4">Edit FoodOrder</h1>
{{ include('_form.html.twig', {'button_label': 'Update'}) }}
<div class="mb-4">
{{ include('_form.html.twig', {'button_label': 'Update'}) }}
</div>
<a href="{{ path('app_food_order_index') }}">back to list</a>
<a class="btn btn-secondary" href="{{ path('app_food_order_index') }}">back to list</a>
{% endblock %}

View file

@ -3,17 +3,18 @@
{% block title %}FoodOrder index{% endblock %}
{% block body %}
<h1>FoodOrder index</h1>
<div>
<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">
<thead>
<table class="table table-striped table-hover">
<thead class="table-light">
<tr>
<th>CreatedBy</th>
<th>Vendor</th>
@ -28,7 +29,7 @@
{% endfor %}
{% if food_orders|length < 10 %}
<tr>
<td colspan="5">
<td colspan="5" class="text-center text-muted">
check the <a href="{{ path('app_food_order_archive') }}">archive</a>
for older orders
</td>
@ -36,10 +37,12 @@
{% endif %}
</tbody>
</table>
{% if prev_page > 0 %}
<a href="{{ path('app_food_order_archive', {'page': prev_page}) }}">previous page</a> |
{% endif %}
{% if next_page > current_page %}
<a href="{{ path('app_food_order_archive', {'page': next_page}) }}">next page</a>
{% endif %}
<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 %}

View file

@ -1,2 +1,4 @@
{{ include('_form.html.twig') }}
<div class="mb-4">
{{ include('_form.html.twig') }}
</div>

View file

@ -3,9 +3,9 @@
{% block title %}FoodOrder{% endblock %}
{% block body %}
<h1>FoodOrder</h1>
<h1 class="mb-4">FoodOrder</h1>
<table class="table">
<table class="table table-bordered table-striped w-auto">
<tbody>
<tr>
<th>Vendor</th>
@ -29,16 +29,18 @@
</tr>
</tbody>
</table>
<a class="button" href="{{ path('app_food_order_index') }}">back to list</a>
{% if(food_order.isClosed) %}
<a class="button" href="{{ path('app_food_order_open', {'id': food_order.id}) }}">reopen</a>
{% else %}
<a class="button" href="{{ path('app_food_order_close', {'id': food_order.id}) }}">close</a>
{% endif %}
<div class="mb-3 d-flex gap-2">
<a class="btn btn-secondary" href="{{ path('app_food_order_index') }}">back to list</a>
{% if(food_order.isClosed) %}
<a class="btn btn-warning" href="{{ path('app_food_order_open', {'id': food_order.id}) }}">reopen</a>
{% else %}
<a class="btn btn-success" href="{{ path('app_food_order_close', {'id': food_order.id}) }}">close</a>
{% endif %}
</div>
<h2>Items</h2>
<table class="table">
<thead>
<h2 class="mt-5">Items</h2>
<table class="table table-hover">
<thead class="table-light">
<tr>
<th>Index</th>
<th>username</th>
@ -57,15 +59,15 @@
<td>
{% if(food_order.isClosed) %}
{% else %}
<a href="{{ path('app_order_item_edit', {'id': item.id}) }}">edit</a>
<a href="{{ path('app_order_item_copy', {'id': item.id}) }}">copy</a>
<a href="{{ path('app_order_item_delete', {'id': item.id}) }}">remove</a>
<a class="btn btn-sm btn-outline-primary me-1" href="{{ path('app_order_item_edit', {'id': item.id}) }}">edit</a>
<a class="btn btn-sm btn-outline-secondary me-1" href="{{ path('app_order_item_copy', {'id': item.id}) }}">copy</a>
<a class="btn btn-sm btn-outline-danger" href="{{ path('app_order_item_delete', {'id': item.id}) }}">remove</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="button" href="{{ path('app_order_item_new', {'foodOrder': food_order.id}) }}">New Item</a>
<a class="btn btn-primary mt-2" href="{{ path('app_order_item_new', {'foodOrder': food_order.id}) }}">New Item</a>
{% endblock %}

View file

@ -4,6 +4,6 @@
<td>{{ food_order.createdAt ? food_order.createdAt|date('Y-m-d H:i:s', 'Europe/Berlin') : '' }}</td>
<td>{{ food_order.closedAt ? food_order.closedAt|date('Y-m-d H:i:s', 'Europe/Berlin') : '' }}</td>
<td>
<a href="{{ path('app_food_order_show', {'id': food_order.id}) }}">show</a>
<a class="btn btn-sm btn-outline-info" href="{{ path('app_food_order_show', {'id': food_order.id}) }}">show</a>
</td>
</tr>