thread: use the thread widget for top comments

This allows the top comment to be permalinked and edited as any comment,
following the intent of pinning normal comments to the top.
This commit is contained in:
Lephe 2020-10-31 15:33:29 +01:00
parent c7846c4f8b
commit 36ccb16536
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
2 changed files with 5 additions and 8 deletions

View File

@ -11,14 +11,11 @@
{% block content %}
<section>
<h1>{{ t.title }}</h1>
<table class="thread"><tr>
<td class="author">{{ widget_user.profile(t.author ) }}</td>
<td>{{ t.thread.top_comment.text|md }}</td>
</tr></table>
{{ widget_thread.thread([t.thread.top_comment], None) }}
{{ widget_pagination.paginate(comments, 'forum_topic', t, {'f': t.forum}) }}
{{ widget_thread.thread(comments, t.thread.top_comment) }}
{{ widget_thread.thread(comments.items, t.thread.top_comment) }}
{{ widget_pagination.paginate(comments, 'forum_topic', t, {'f': t.forum}) }}

View File

@ -1,9 +1,9 @@
{% import "widgets/user.html" as widget_user %}
{% import "widgets/attachments.html" as widget_attachments %}
{% macro thread(comments, top_comment, anchor) %}
<table class="thread">
{% for c in comments.items %}
{% macro thread(comments, top_comment) %}
<table class="thread {{ 'topcomment' if top_comment == None else ''}} ">
{% for c in comments %}
<tr id="{{ c.id }}">
{% if c != top_comment %}
<td class="author">{{ widget_user.profile(c.author) }}</td>