updateeeeee
This commit is contained in:
parent
0c758749e0
commit
ca9819a436
12 changed files with 214 additions and 156 deletions
|
@ -5,35 +5,6 @@
|
|||
{% block body %}
|
||||
<div class="container">
|
||||
<h1>Drink Inventory</h1>
|
||||
{% if low is not same as([]) %}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">Low Stock Alert</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Drink Name</th>
|
||||
<th>Current Stock</th>
|
||||
<th>Desired Stock</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for lowStock in low %}
|
||||
<tr>
|
||||
<td><a href="{{ path('app_drink_type_show', {'id': lowStock.record.drinkType.id}) }}">{{ lowStock.record.drinkType.name }}</a></td>
|
||||
<td>{{ lowStock.record.quantity }}</td>
|
||||
<td>{{ lowStock.record.drinkType.desiredStock }}</td>
|
||||
<td>{{ lowStock.stock.value|capitalize }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">Drink Inventory Overview</h5>
|
||||
|
@ -43,36 +14,22 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Drink Name</th>
|
||||
<th>Description</th>
|
||||
<th>Current Stock</th>
|
||||
<th>Desired Stock</th>
|
||||
<th>Status</th>
|
||||
<th>Wanted Stock</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for drinkStock in drinkStocks %}
|
||||
{% set rowClass = '' %}
|
||||
{% if drinkStock.stock.value == 'critical' %}
|
||||
{% set rowClass = 'table-danger' %}
|
||||
{% elseif drinkStock.stock.value == 'low' %}
|
||||
{% set rowClass = 'table-warning' %}
|
||||
{% elseif drinkStock.stock.value == 'high' %}
|
||||
{% set rowClass = 'table-success' %}
|
||||
{% endif %}
|
||||
<tr class="{{ rowClass }}">
|
||||
<td><a href="{{ path('app_drink_type_show', {'id': drinkStock.record.drinkType.id}) }}">{{ drinkStock.record.drinkType.name }}</a></td>
|
||||
<td>{{ drinkStock.record.quantity }}</td>
|
||||
<td>{{ drinkStock.record.drinkType.desiredStock }}</td>
|
||||
<td>{{ drinkStock.stock.value|capitalize }}</td>
|
||||
{% 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>
|
||||
<a href="{{ path('app_inventory_record_modal', {drinkType: drinkStock.record.drinkType.id}) }}"
|
||||
class="btn btn-primary"
|
||||
hx-get="{{ path('app_inventory_record_modal', {drinkType: drinkStock.record.drinkType.id}) }}"
|
||||
hx-target="#htmxModalBody"
|
||||
hx-trigger="click"
|
||||
data-bs-toggle="modal"
|
||||
data-bs-target="#htmxModal"
|
||||
data-drink-name="{{ drinkStock.record.drinkType.name }}">Update Stock</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -81,7 +38,6 @@
|
|||
<div class="mt-3">
|
||||
<a href="{{ path('app_drink_type_index') }}" class="btn btn-primary">View All Drinks</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue