PCv5/app/templates/forum/topic.html

89 lines
3.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 %}
{% import "widgets/attachments.html" as widget_attachments %}
{% set tabtitle = t.forum.name + " - " + t.title %}
{% 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>
{% if t.summary %}
<div>{{ t.summary | md }}</div>
{% endif %}
{% if t.thread.top_comment %}
{% call widget_thread.thread_leader(t.thread.top_comment, t) %}
<div class="info">
<div>
Créé le {{ t.date_created | dyndate }}
<!-- We check if the formatted date is not the same, because the date might differ slightly between the two even if it's the same -->
{% if t.thread.top_comment.date_created | dyndate != t.date_created | dyndate %}
(Posté le {{ t.thread.top_comment.date_created | dyndate }})
{% endif %}
</div>
{{ widget_thread.post_actions(t) }}
</div>
{{ t.thread.top_comment.text | md }}
{{ widget_attachments.attachments(t.thread.top_comment) }}
{% endcall %}
{% endif %}
{{ 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 t.thread.locked %}
<div class="locked">Les commentaires sont verrouillés</div>
{% elif 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 %}