Django_Basic_Manufacturing_3/templates/purchasing/supplier_list.html
2025-08-22 17:05:22 +07:00

80 lines
3.4 KiB
HTML

{% extends 'base.html' %}
{% block title %}Supplier 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">Supplier List</h1>
<div class="btn-toolbar mb-2 mb-md-0">
<a href="{% url 'purchasing:create_supplier' %}" class="btn btn-sm btn-outline-success">
<i class="fas fa-plus"></i> Add Supplier
</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>
<tr>
<th>Code</th>
<th>Name</th>
<th>Contact Person</th>
<th>Email</th>
<th>Phone</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for supplier in suppliers %}
<tr>
<td><strong>{{ supplier.code }}</strong></td>
<td>{{ supplier.name }}</td>
<td>{{ supplier.contact_person|default:"-" }}</td>
<td>{{ supplier.email|default:"-" }}</td>
<td>{{ supplier.phone|default:"-" }}</td>
<td>
{% if supplier.is_active %}
<span class="badge bg-success">Active</span>
{% else %}
<span class="badge bg-secondary">Inactive</span>
{% endif %}
</td>
<td>
<div class="btn-group" role="group">
<a href="{% url 'purchasing:supplier_detail' supplier.id %}" class="btn btn-sm btn-outline-primary">
<i class="fas fa-eye"></i>
</a>
<a href="{% url 'purchasing:edit_supplier' supplier.id %}" class="btn btn-sm btn-outline-secondary">
<i class="fas fa-edit"></i>
</a>
<a href="{% url 'purchasing:delete_supplier' supplier.id %}" class="btn btn-sm btn-outline-danger">
<i class="fas fa-trash"></i>
</a>
</div>
</td>
</tr>
{% empty %}
<tr>
<td colspan="7" class="text-center text-muted">
No suppliers found. <a href="{% url 'purchasing:create_supplier' %}">Create your first supplier</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}