PCv5/app/templates/forum/topic.html

64 lines
2.1 KiB
HTML

{% extends "base/base.html" %}
{% import "widgets/editor.html" as widget_editor %}
{% import "widgets/thread.html" as widget_thread with context %}
{% import "widgets/user.html" as widget_user %}
{% import "widgets/pagination.html" as widget_pagination with context %}
{% block title %}
<a href='/forum'>Forum de Planète Casio</a> » <a href="{{ url_for('forum_page', f=t.forum) }}">{{ t.forum.name }}</a> » <h1>{{ t.title }}</h1>
{% endblock %}
{% block content %}
<section>
<h1>{{ t.title }}</h1>
{{ widget_thread.thread([t.thread.top_comment], None) }}
{{ widget_pagination.paginate(comments, 'forum_topic', t, {'f': t.forum}) }}
{{ widget_thread.thread(comments.items, t.thread.top_comment) }}
{{ widget_pagination.paginate(comments, 'forum_topic', t, {'f': t.forum}) }}
{% if outdated %}
<div class="bg-warn">
Ce topic est sans activité depuis {{ outdated }} jours, êtes-vous sûr de vouloir y poster ?
</div>
{% endif %}
{% if V5Config.ENABLE_GUEST_POST
or (current_user.is_authenticated and current_user.can_post_in_forum(t.forum)) %}
<div class=form>
<h3>Commenter le sujet</h3>
<form action="" method="post" enctype="multipart/form-data">
{{ form.hidden_tag() }}
{% if form.pseudo %}
<div>
{{ form.pseudo.label }}
{{ form.pseudo }}
{% for error in form.pseudo.errors %}
<span class="msgerror">{{ error }}</span>
{% endfor %}
{{ form.ab }}
</div>
{% endif %}
{{ widget_editor.text_editor(form.message, label=False) }}
<div>
{{ form.attachments.label }}
<div>
{{ form.attachments }}
{% for error in form.attachments.errors %}
<span class="msgerror">{{ error }}</span>
{% endfor %}
</div>
</div>
<div>{{ form.submit(class_='bg-ok') }}</div>
</form>
</div>
{% endif %}
</section>
{% endblock %}