Moona/templates/add_question.html

51 lines
1.9 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.

<link rel="stylesheet" href="../static/css/diary.css">
<link rel="stylesheet" href="../static/css/question.css">
{% extends "base.html" %}
{% block content %}
{% if current_user.is_authenticated and (current_user.role == 'admin' or current_user.role == 'moder') %}
<div class="all_div">
<div class="add_q">
<h1 class="h_q">Введите новый вопрос</h1>
<form action="" method="POST" enctype="multipart/form-data">
{{ form.hidden_tag() }}
{{ form.csrf_token }}
<p>
{{ form.quest.label }}<br>
{{ form.quest(class="form-control") }}<br>
{% for error in form.quest.errors %}
<div class="alert alert-danger" role="alert">
{{ error }}
</div>
{% endfor %}
</p>
<p>{{ form.submit(type="submit", class="btn btn-primary") }}</p>
{% if message != '' %}
<div class="alert alert-danger" role="alert">{{ message }}</div>
{% endif %}
</form>
</div>
<div class="edit_q">
<details>
<summary>
Все вопросы
</summary>
{% for item in question %}
<div class="alert alert-primary" role="alert">
<strong>{{item.quest}}</strong>
<a href="/delete_quest/{{item.id}}" class="alert alert-danger" role="alert"><strong>Удалить</strong></a>
</div>
{% endfor %}
</details>
</div>
</div>
{% else %}
<div class="bad_user">
<div class="bad_centre">
<h1 id="hz1">У вас нет прав доступа!</h1>
<h2 id="hz2">Эта страница предназначена только для руководства сайта!</h2>
<p></p>
<img id="image" src="../static/img/Надпись Moona без фона.png"></div>
</div>
{% endif %}
{% endblock %}