zxcqwe/templates/categories.html

30 lines
1,013 B
HTML

{% extends "base.html" %}
{% block content %}
<h2>Категории лекарств</h2>
<a href="/add_category" class="btn btn-primary mb-3">Добавить категорию</a>
<table class="table table-striped">
<thead>
<tr>
<th>Название</th>
<th>Описание</th>
<th>Действия</th>
</tr>
</thead>
<tbody>
{% for c in categories %}
<tr>
<td>{{ c.name }}</td>
<td>{{ c.description or '-' }}</td>
<td>
<a href="/edit_category/{{ c.id }}" class="btn btn-sm btn-primary">✏️</a>
<form action="/delete_category/{{ c.id }}" method="POST" style="display:inline;">
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Удалить?')">🗑️</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}