project322/templates/categories.html

37 lines
1.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block title %}Категории{% endblock %}
{% block content %}
<div class="page-header">
<h2>📊 Категории товаров</h2>
<a href="{{ url_for('new_category') }}" class="btn btn-primary">➕ Новая категория</a>
</div>
<table>
<thead>
<tr>
<th>ID</th>
<th>Название</th>
<th>Описание</th>
<th>Товаров</th>
<th>Действия</th>
</tr>
</thead>
<tbody>
{% for category in categories %}
<tr>
<td>{{ category.id }}</td>
<td><strong>{{ category.name }}</strong></td>
<td>{{ category.description or '—' }}</td>
<td>{{ category.products|length }}</td>
<td class="actions">
<a href="{{ url_for('category_detail', id=category.id) }}" class="btn btn-small" title="Просмотр">👁️</a>
<a href="{{ url_for('edit_category', id=category.id) }}" class="btn btn-small" title="Редактировать">✏️</a>
<a href="{{ url_for('delete_category', id=category.id) }}" class="btn btn-small btn-delete" onclick="return confirm('Удалить категорию {{ category.name }}?')" title="Удалить">🗑️</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}