Initial commit
This commit is contained in:
51
templates/admin/surveys.html
Normal file
51
templates/admin/surveys.html
Normal file
@@ -0,0 +1,51 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
<h2 class="mb-4">Опросники</h2>
|
||||
|
||||
<form method="post" class="mb-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="name" class="form-control" placeholder="Название опроса" required>
|
||||
<button type="submit" class="btn btn-primary">Создать</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% for survey in surveys %}
|
||||
<div class="card mb-4 p-3">
|
||||
<h5>{{ survey.name }}</h5>
|
||||
|
||||
<!-- Старая админская панель -->
|
||||
<div class="btn-group mb-3">
|
||||
<a href="{{ url_for('manage_products', survey_id=survey.id) }}" class="btn btn-sm btn-outline-secondary">Категории и вопросы</a>
|
||||
<a href="{{ url_for('manage_platforms_by_survey', survey_id=survey.id) }}" class="btn btn-sm btn-outline-primary">Продукты</a>
|
||||
<a href="{{ url_for('manage_support_by_survey', survey_id=survey.id) }}" class="btn btn-sm btn-outline-success">Матрица</a>
|
||||
<form method="post" action="{{ url_for('delete_survey', survey_id=survey.id) }}" onsubmit="return confirm('Удалить опрос {{ survey.name }}?')">
|
||||
<button type="submit" class="btn btn-sm btn-danger">Удалить</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Назначения пользователям -->
|
||||
{% if current_user.is_admin %}
|
||||
<!-- Назначения пользователям (только для админа) -->
|
||||
<form method="POST" action="{{ url_for('assign_bulk_surveys') }}">
|
||||
<input type="hidden" name="survey_id" value="{{ survey.id }}">
|
||||
<div class="row row-cols-2 row-cols-md-3 row-cols-lg-4 g-2">
|
||||
{% for user in users %}
|
||||
<div class="form-check col">
|
||||
<input class="form-check-input" type="checkbox" name="user_ids" value="{{ user.id }}"
|
||||
id="user{{ user.id }}_survey{{ survey.id }}"
|
||||
{% if user.id in assignments[survey.id] %}checked{% endif %}>
|
||||
<label class="form-check-label" for="user{{ user.id }}_survey{{ survey.id }}">
|
||||
{{ user.username }} ({{ user.full_name or "без ФИО" }})
|
||||
</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<button class="btn btn-sm btn-primary">Сохранить назначения</button>
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user