05/07 Phase 3: initial codes
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
{% extends "tenant/layouts/base.html" %}
|
||||
{% block title %}Gift Card Lookup{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-5">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header fw-semibold">Gift Card Lookup</div>
|
||||
<div class="card-body">
|
||||
<form method="GET" class="mb-3">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control font-monospace" name="code"
|
||||
value="{{ code }}" placeholder="XXXX-XXXX-XXXX" autofocus>
|
||||
<button class="btn btn-primary">Look Up</button>
|
||||
</div>
|
||||
</form>
|
||||
{% if code and card %}
|
||||
<div class="alert {{ 'alert-success' if card.is_active else 'alert-warning' }}">
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-sm-5">Code</dt><dd class="col-sm-7 font-monospace">{{ card.code }}</dd>
|
||||
<dt class="col-sm-5">Original Value</dt><dd class="col-sm-7">${{ "%.2f"|format(card.original_value) }}</dd>
|
||||
<dt class="col-sm-5">Remaining Balance</dt>
|
||||
<dd class="col-sm-7 fw-bold {% if card.remaining_balance <= 0 %}text-danger{% endif %}">
|
||||
${{ "%.2f"|format(card.remaining_balance) }}
|
||||
</dd>
|
||||
<dt class="col-sm-5">Status</dt>
|
||||
<dd class="col-sm-7">{{ 'Active' if card.is_active else 'Inactive / Depleted' }}</dd>
|
||||
{% if card.expires_at %}
|
||||
<dt class="col-sm-5">Expires</dt><dd class="col-sm-7">{{ card.expires_at.strftime('%Y-%m-%d') }}</dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
{% elif code %}
|
||||
<div class="alert alert-danger">No gift card found with code <strong>{{ code }}</strong>.</div>
|
||||
{% endif %}
|
||||
<a href="{{ url_for('gift_cards.index') }}" class="btn btn-outline-secondary btn-sm">Back</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user