Django_Basic_Manufacturing_3/templates/manufacturing/bom_list.html
2025-08-22 17:05:22 +07:00

77 lines
3.1 KiB
HTML

{% extends 'base.html' %}
{% load static %}
{% block title %}Bill of Materials List - Manufacturing App{% endblock %}
{% block content %}
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">Bill of Materials</h1>
<div class="btn-toolbar mb-2 mb-md-0">
<a href="{% url 'manufacturing:create_bom' %}" class="btn btn-sm btn-outline-success">
<i class="fas fa-plus"></i> Create BOM
</a>
</div>
</div>
{% if messages %}
{% for message in messages %}
<div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead class="table-dark">
<tr>
<th>BOM Code</th>
<th>Product</th>
<th>Version</th>
<th>Status</th>
<th>Created</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for bom in boms %}
<tr>
<td><strong>{{ bom.bom_code }}</strong></td>
<td>{{ bom.product.name }}</td>
<td>{{ bom.version }}</td>
<td>
{% if bom.is_active %}
<span class="badge bg-success">Active</span>
{% else %}
<span class="badge bg-secondary">Inactive</span>
{% endif %}
</td>
<td>{{ bom.created_at|date:"M d, Y" }}</td>
<td>
<div class="btn-group" role="group">
<a href="{% url 'manufacturing:bom_detail' bom.id %}" class="btn btn-sm btn-outline-primary" title="View">
<i class="fas fa-eye"></i>
</a>
<a href="{% url 'manufacturing:edit_bom' bom.id %}" class="btn btn-sm btn-outline-secondary" title="Edit">
<i class="fas fa-edit"></i>
</a>
</div>
</td>
</tr>
{% empty %}
<tr>
<td colspan="6" class="text-center text-muted">
No bills of materials found.
<a href="{% url 'manufacturing:create_bom' %}">Create your first BOM</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}