saufen/templates/index.html.twig
2025-06-14 23:13:20 +02:00

74 lines
3.1 KiB
Twig

{% extends 'base.html.twig' %}
{% block title %}Inventory Overview{% endblock %}
{% block body %}
<div class="container">
<h1>Drink Inventory</h1>
{% if lowStock != [] %}
<div class="card">
<div class="card-header bg-danger">
<h5 class="card-title">LOW STOCK ALERT</h5>
</div>
<div class="card-body">
<ul>
{% for drinkType in lowStock %}
<li>{{ drinkType.name }} ({{ drinkType.currentStock }} / {{ drinkType.wantedStock }})</li>
{% endfor %}
</ul>
{% if orders == [] %}
<a href="{{ path('app_drink_type_bulk_edit_wanted_stock', {'from_order': 'true'}) }}" class="btn btn-primary">Create New Order</a>
{% else %}
<p>There are already orders planned:</p>
<ul>
{% for order in orders %}
<li>
<a href="{{ path("app_order_show", {'id': order.id}) }}">
{{ order.id }} - {{ order.status.value }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% endif %}
<div class="card mt-3">
<div class="card-header">
<h5 class="card-title">Drink Inventory Overview</h5>
</div>
<div class="card-body">
<table class="table table-striped">
<thead>
<tr>
<th>Drink Name</th>
<th>Description</th>
<th>Current Stock</th>
<th>Wanted Stock</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for drinkType in drinkTypes %}
<tr>
<td>
<a href="{{ path('app_drink_type_show', {'id': drinkType.id}) }}">{{ drinkType.name }}</a>
</td>
<td>{{ drinkType.description }}</td>
<td>{{ drinkType.currentStock }}</td>
<td>{{ drinkType.wantedStock }}</td>
<td>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="mt-3">
<a href="{{ path('app_drink_type_index') }}" class="btn btn-primary">View All Drinks</a>
<a href="{{ path('app_drink_type_bulk_edit_stock') }}" class="btn btn-secondary">Mass Update Current Stock</a>
<a href="{{ path('app_drink_type_bulk_edit_wanted_stock') }}" class="btn btn-secondary">Mass Update Wanted Stock</a>
</div>
</div>
</div>
</div>
{% endblock %}