Django_Basic_Manufacturing_3/templates/dashboard/widgets/table_widget.html
2025-08-22 17:05:22 +07:00

50 lines
1.9 KiB
HTML

<div class="card h-100">
<div class="card-body">
<div class="widget-header">
<h5 class="widget-title">{{ widget.title }}</h5>
<div class="widget-actions">
<button class="btn btn-sm btn-outline-secondary" onclick="refreshWidget({{ widget.id }})">
<i class="fas fa-sync"></i>
</button>
</div>
</div>
<div class="widget-content">
{% if data.items %}
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Product</th>
<th>Warehouse</th>
<th>Quantity</th>
<th>Reorder Level</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{% for item in data.items %}
<tr>
<td>{{ item.product.name }}</td>
<td>{{ item.warehouse.name }}</td>
<td>{{ item.quantity }}</td>
<td>{{ item.reorder_level }}</td>
<td>
{% if item.quantity <= item.reorder_level %}
<span class="badge bg-danger">Low Stock</span>
{% else %}
<span class="badge bg-success">OK</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="text-center text-muted">
No low stock items
</div>
{% endif %}
</div>
</div>
</div>