feat: add inline recent comments and reply forms to post cards on feed page

Extract comment item building into `_build_comment_items` helper in database.py, import `get_recent_comments_by_post_uids` in feed router to attach up to 3 recent comments per post, add `post-card-comments` CSS class and `.comment-reply-form` margin rule, refactor `CommentManager` to use event delegation and toggle reply forms via a hidden template, move comment rendering into a reusable `_comment.html` macro, and include recent comments in `_post_card.html` with inline reply capability.
This commit is contained in:
2026-06-05 16:42:43 +00:00
parent 7d4612b2eb
commit 5a263cfebe
9 changed files with 155 additions and 88 deletions
+6
View File
@@ -167,6 +167,12 @@
</footer>
{% endblock %}
{% if user %}
<template id="comment-reply-template">
{% set _comment_target_uid = "" %}{% set _comment_target_type = "" %}{% include "_comment_form.html" %}
</template>
{% endif %}
<script defer src="/static/vendor/marked.umd.js"></script>
<script defer src="/static/vendor/highlight.min.js"></script>
<script defer src="/static/vendor/purify.min.js"></script>