Initial commit
This commit is contained in:
35
templates/admin/features.html
Normal file
35
templates/admin/features.html
Normal file
@@ -0,0 +1,35 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
<h2 class="mb-4">Вопросы категории: <span class="text-primary">{{ product.name }}</span></h2>
|
||||
|
||||
<form method="post" class="mb-4">
|
||||
<div class="row g-2">
|
||||
|
||||
<div class="col-md-10">
|
||||
<textarea name="question_text" class="form-control" placeholder="Текст вопроса" rows="1" required></textarea>
|
||||
</div>
|
||||
<div class="col-md-2 d-grid">
|
||||
<button type="submit" class="btn btn-success">➕ Добавить</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<ul class="list-group shadow-sm">
|
||||
{% for feature in features %}
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<strong>{{ feature.name }}</strong><br>
|
||||
<small class="text-muted">{{ feature.question_text }}</small>
|
||||
</div>
|
||||
<form method="post" action="{{ url_for('delete_feature', feature_id=feature.id, product_id=product.id) }}"
|
||||
onsubmit="return confirm('Удалить вопрос «{{ feature.name }}»?');">
|
||||
<button class="btn btn-sm btn-outline-danger">🗑 Удалить</button>
|
||||
</form>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="list-group-item text-center text-muted">Нет добавленных вопросов</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<a href="{{ url_for('manage_products', survey_id=product.survey_type.id) }}" class="btn btn-link mt-4">← Назад к категориям</a>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user