From 24c508f5522b8e7b78050c921ab6604da131a5a4 Mon Sep 17 00:00:00 2001 From: Hendrik L Date: Wed, 10 Jul 2024 21:13:43 +0200 Subject: [PATCH] proper comment teaser in flexbox layout --- app/templates/post/_post_reply_teaser.html | 88 +++++++++++++++++++++- 1 file changed, 84 insertions(+), 4 deletions(-) diff --git a/app/templates/post/_post_reply_teaser.html b/app/templates/post/_post_reply_teaser.html index 1913fb0a..4c3d9902 100644 --- a/app/templates/post/_post_reply_teaser.html +++ b/app/templates/post/_post_reply_teaser.html @@ -1,5 +1,85 @@ -
- {{ post_reply.body_html|safe }} -

{{ _('View context') }}

+{# Options: + teaser: Renders just a teaser + disable_voting: Disable voting buttons (to prevent mass downvoting) + no_collapse: Don't collapse for admin and moderator views +#} +{% set collapsed = (post_reply.score <= current_user.reply_collapse_threshold) + and not no_collapse -%} +
+ {% if not post_reply.author.indexable -%}{% endif -%} + {% if teaser -%} + + {% endif -%} +
+
+ {{ render_communityname(post_reply.post.community) }} +
+
+ by + {{ render_username(post_reply.author) }} + {% if post_reply.author.id == post_reply.post.author.id -%} + [OP] + {% endif -%} +
+
+ {{ moment(post_reply.posted_at).fromNow(refresh=True) }} + {% if post_reply.edited_at -%}, edited {{ moment(post_reply.edited_at).fromNow(refresh=True) }} {% endif -%} +
+
+ {% if post_reply.reports and current_user.is_authenticated and post_reply.post.community.is_moderator(current_user) -%} + + {% endif -%} +
+
+ +
+
+ +
+
+ {{ post_reply.body_html | community_links | safe }} +
+
+
+
+ {% if post_reply.post.comments_enabled -%} + reply + {% endif -%} +
+
+ {% if not disable_voting -%} + {% with comment=post_reply, community=post_reply.post.community -%} + {% include "post/_comment_voting_buttons.html" -%} + {% endwith -%} + {% endif -%} +
+
+ {% if collapsed -%} + + {% else -%} + + {% endif -%} +
+
+ {% with comment=dict(comment=post_reply) -%} + {% include "post/_reply_notification_toggle.html" -%} + {% endwith -%} +
+
+ +
+
+ {% if not post_reply.author.indexable -%}{% endif -%} + {% if collapsed -%} + + {% endif -%}
-
\ No newline at end of file