Files
Quiz-for-Mont/templates/admin/products.html
2025-09-04 11:27:16 +03:00

33 lines
1.5 KiB
HTML
Raw Permalink 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 "layout.html" %}
{% block content %}
<h2 class="mb-4">Категории опроса: <span class="text-primary">{{ survey.name }}</span></h2>
<form method="post" class="mb-4">
<div class="input-group shadow-sm">
<input type="text" name="name" class="form-control" placeholder="Название категории (например: Базовые возможности)" required>
<button type="submit" class="btn btn-success"> Добавить</button>
</div>
</form>
<div class="list-group shadow-sm">
{% for product in products %}
<div class="list-group-item d-flex justify-content-between align-items-center">
<div>
<strong>{{ product.name }}</strong>
</div>
<div class="d-flex gap-2">
<a href="{{ url_for('manage_features', product_id=product.id) }}" class="btn btn-sm btn-outline-primary">Вопросы</a>
<form method="post" action="{{ url_for('delete_product', product_id=product.id, survey_id=survey.id) }}"
onsubmit="return confirm('Удалить категорию «{{ product.name }}»?');">
<button class="btn btn-sm btn-outline-danger">🗑</button>
</form>
</div>
</div>
{% else %}
<div class="list-group-item text-muted text-center">Нет категорий</div>
{% endfor %}
</div>
<a href="{{ url_for('manage_surveys') }}" class="btn btn-link mt-4">← Назад к опросникам</a>
{% endblock %}