97 lines
2.8 KiB
Twig
97 lines
2.8 KiB
Twig
{% extends 'base.html.twig' %}
|
|
|
|
{% block title %}FoodOrder{% endblock %}
|
|
|
|
{% block body %}
|
|
<h1>FoodOrder</h1>
|
|
|
|
<table class="table">
|
|
<tbody>
|
|
<tr>
|
|
<th>StartedByName</th>
|
|
<td>{{ food_order.startedBy }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Id</th>
|
|
<td>{{ food_order.id }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>StartedAt</th>
|
|
<td>{{ food_order.startedAt ? food_order.startedAt|date('Y-m-d H:i:s') : '' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th>ClosedAt</th>
|
|
<td>
|
|
{% if food_order.closedAt is not null%}
|
|
{{ food_order.closedAt|date('Y-m-d H:i:s') }}
|
|
{% else %}
|
|
<a href="{{ path('app_foodorder_close', {id: food_order.id}) }}">close</a>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name(s)</th>
|
|
<th>Extra(s)</th>
|
|
<th>possible price</th>
|
|
<th>actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for orderItem in food_order.groupedOrderItems %}
|
|
<tr>
|
|
<td>
|
|
{{ orderItem.item.menuItem.menuItemAliases|map(i => i.name)|join(' / ') }}
|
|
</td>
|
|
<td>
|
|
{{ orderItem.item.extras|map(i => i.name)|join(' / ') }}
|
|
</td>
|
|
<td>
|
|
{{ orderItem.item.menuItem.price|cents_to_eur }}
|
|
</td>
|
|
<td>
|
|
{{ orderItem.amount }} |
|
|
<a href="{{ path('app_foodorder_add_item', {foodOrder: food_order.id, menuItem: orderItem.item.menuItem.id}) }}">+1</a> |
|
|
<a href="{{ path('app_foodorder_remove_item', {foodOrder: food_order.id, orderItem: orderItem.item.id}) }}">-1</a> |
|
|
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name(s)</th>
|
|
<th>possible price</th>
|
|
<th>actions</th>
|
|
</tr>
|
|
</thead>
|
|
{% for item in menu_items %}
|
|
<tr>
|
|
<td>
|
|
{{ item.menuItemAliases|map(i => i.name)|join(' / ') }}
|
|
</td>
|
|
<td>
|
|
{{ item.price|cents_to_eur }}
|
|
</td>
|
|
<td>
|
|
{% if food_order.closedAt is null %}
|
|
<a
|
|
href="{{ path(
|
|
'app_foodorder_add_item',
|
|
{
|
|
foodOrder: food_order.id,
|
|
menuItem: item.id
|
|
}
|
|
) }}"
|
|
>add</a>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endblock %}
|