05/07 Phase 3: initial codes
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
{% extends "tenant/layouts/base.html" %}
|
||||
{% block title %}Customers{% endblock %}
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h4 class="fw-bold mb-0"><i class="bi bi-people me-2"></i>Customers</h4>
|
||||
<a href="{{ url_for('customers.create') }}" class="btn btn-primary btn-sm">
|
||||
<i class="bi bi-plus-lg me-1"></i>New Customer
|
||||
</a>
|
||||
</div>
|
||||
<div class="card shadow-sm mb-3">
|
||||
<div class="card-body py-2">
|
||||
<form method="GET" class="d-flex gap-2">
|
||||
<input type="search" class="form-control form-control-sm" name="q"
|
||||
value="{{ q }}" placeholder="Search by name, phone, or email…" autofocus>
|
||||
<button class="btn btn-outline-secondary btn-sm">Search</button>
|
||||
{% if q %}<a href="{{ url_for('customers.index') }}" class="btn btn-outline-danger btn-sm">Clear</a>{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0">
|
||||
<thead class="table-light"><tr><th>Name</th><th>Phone</th><th>Email</th><th>Loyalty</th><th>No-Shows</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for c in customers %}
|
||||
<tr>
|
||||
<td><a href="{{ url_for('customers.view', customer_id=c.id) }}" class="text-decoration-none fw-semibold">{{ c.name }}</a></td>
|
||||
<td class="text-muted small">{{ c.phone or '—' }}</td>
|
||||
<td class="text-muted small">{{ c.email or '—' }}</td>
|
||||
<td><span class="badge bg-warning text-dark">{{ c.loyalty_points }} pts</span></td>
|
||||
<td>{% if c.no_show_count > 0 %}<span class="badge bg-danger">{{ c.no_show_count }}</span>{% else %}0{% endif %}</td>
|
||||
<td><a href="{{ url_for('customers.edit', customer_id=c.id) }}" class="btn btn-outline-secondary btn-sm">Edit</a></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="6" class="text-center text-muted py-4">No customers found.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user