Files
shop-pip/app/templates/admin/keys.html
T

45 lines
1.2 KiB
HTML

{% extends "admin/base.html" %}
{% block title %}Ключи — {{ product.title }}{% endblock %}
{% block content %}
<div class="section-head">
<h2>Ключи: {{ product.title }}</h2>
<p>Свободно: {{ stock }} шт.</p>
</div>
{% if message %}
<p class="flash ok">{{ message }}</p>
{% endif %}
<form method="post" class="stack-form">
<label>
Добавить ключи (по одному на строку)
<textarea name="codes" rows="8" required placeholder="XXXX-YYYY-ZZZZ"></textarea>
</label>
<button class="btn btn-primary" type="submit">Загрузить</button>
</form>
<div class="table-wrap" style="margin-top: 2rem">
<table class="data-table">
<thead>
<tr>
<th>Код</th>
<th>Статус</th>
<th>Order</th>
</tr>
</thead>
<tbody>
{% for key in keys %}
<tr>
<td><code>{{ key.code }}</code></td>
<td>{% if key.is_sold %}sold{% else %}free{% endif %}</td>
<td>{% if key.order_id %}#{{ key.order_id }}{% else %}—{% endif %}</td>
</tr>
{% else %}
<tr><td colspan="3">Ключей пока нет</td></tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}