From 36ccb165366849b41caf8b24a9b29b3247a11278 Mon Sep 17 00:00:00 2001 From: Lephe Date: Sat, 31 Oct 2020 15:33:29 +0100 Subject: [PATCH] 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. --- app/templates/forum/topic.html | 7 ++----- app/templates/widgets/thread.html | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/templates/forum/topic.html b/app/templates/forum/topic.html index 6dc54c1..3c48fda 100644 --- a/app/templates/forum/topic.html +++ b/app/templates/forum/topic.html @@ -11,14 +11,11 @@ {% block content %}

{{ t.title }}

- - - -
{{ widget_user.profile(t.author ) }}{{ t.thread.top_comment.text|md }}
+ {{ 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}) }} diff --git a/app/templates/widgets/thread.html b/app/templates/widgets/thread.html index d34c793..f46817d 100644 --- a/app/templates/widgets/thread.html +++ b/app/templates/widgets/thread.html @@ -1,9 +1,9 @@ {% import "widgets/user.html" as widget_user %} {% import "widgets/attachments.html" as widget_attachments %} -{% macro thread(comments, top_comment, anchor) %} - -{% for c in comments.items %} +{% macro thread(comments, top_comment) %} +
+{% for c in comments %} {% if c != top_comment %}
{{ widget_user.profile(c.author) }}