54 lines
1.8 KiB
HTML
54 lines
1.8 KiB
HTML
{% extends "base.html" %}
|
||
{% block content %}
|
||
<h1>💎 Ювелирные изделия</h1>
|
||
|
||
<div style="margin-bottom: 20px;">
|
||
<a href="/products/add" class="btn btn-primary">➕ Добавить товар</a>
|
||
</div>
|
||
|
||
<div class="stats">
|
||
<div class="stat-card">
|
||
<h3>Всего товаров</h3>
|
||
<div class="number">{{ products|length }}</div>
|
||
</div>
|
||
</div>
|
||
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>Артикул</th>
|
||
<th>Название</th>
|
||
<th>Металл</th>
|
||
<th>Вес (г)</th>
|
||
<th>Коэф.</th>
|
||
<th>Цена</th>
|
||
<th>Описание</th>
|
||
<th>Действия</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for product in products %}
|
||
<tr>
|
||
<td><strong>{{ product.sku }}</strong></td>
|
||
<td>{{ product.name }}</td>
|
||
<td>{{ product.metal_name }} ({{ product.purity }})</td>
|
||
<td>{{ product.weight_grams }}</td>
|
||
<td>{{ product.complexity_factor }}</td>
|
||
<td><strong>{{ "%.2f"|format(product.calculated_price) }} ₽</strong></td>
|
||
<td>{{ product.description or '-' }}</td>
|
||
<td>
|
||
<a href="/products/{{ product.id }}/edit" class="btn btn-secondary btn-small">✏️</a>
|
||
<form method="post" action="/products/{{ product.id }}/delete" style="display: inline;" onsubmit="return confirm('Удалить товар?')">
|
||
<button type="submit" class="btn btn-primary btn-small">🗑️</button>
|
||
</form>
|
||
</td>
|
||
</tr>
|
||
{% else %}
|
||
<tr>
|
||
<td colspan="8" style="text-align: center;">Нет товаров</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{% endblock %}
|