add: forum threads ui

This commit is contained in:
trisua 2025-08-05 16:33:53 -04:00
parent 155fe34c6e
commit 3958d5eaef
8 changed files with 260 additions and 15 deletions

View file

@ -201,7 +201,7 @@
(text "{%- endif %}")
(text "{%- endmacro %}")
(text "{% macro post_buttons_box(post, community, owner, can_manage_post) -%}")
(text "{% macro post_buttons_box(post, community, owner, can_manage_post, show_comments=true) -%}")
(div
("class" "flex justify_between items_center gap_2 w_full")
(text "{% if user -%}")
@ -220,7 +220,7 @@
(text "{%- endif %}")
(div
("class" "flex gap_1 buttons_box")
(text "{% if post.context.comments_enabled %}")
(text "{% if show_comments and post.context.comments_enabled %}")
(a
("href" "/post/{{ post.id }}")
("class" "button camo small")
@ -526,7 +526,7 @@
(text "{{ text \"general:action.delete\" }}"))))))
(text "{%- endmacro %}")
(text "{% macro forum_post(post, owner, community, can_manage_post, poll=false) -%}")
(text "{% macro forum_post(post, owner, community, can_manage_post, poll=false, show_show_thread=true) -%}")
(div
("class" "card_nest_horizontal_wrapper post post:{{ post.id }}")
("data-community" "{{ post.community }}")
@ -580,7 +580,32 @@
(text "{% if poll -%} {{ self::poll(post=post, poll=poll) }} {%- endif %}"))
(hr ("class" "margin_top"))
(text "{{ self::post_buttons_box(post=post, community=community, owner=owner, can_manage_post=can_manage_post) }}"))))
(text "{{ self::post_buttons_box(post=post, community=community, owner=owner, can_manage_post=can_manage_post, show_comments=false) }}"))))
; show thread
(text "{% if show_show_thread and post.comment_count > 0 -%}")
(div
("class" "flex gap_2")
(text "{% if post.context.comments_enabled %}")
(a
("href" "/post/{{ post.id }}")
("class" "button lowered")
(icon (text "message-circle"))
(span
(text "{{ post.comment_count }}")))
(text "{% endif %}")
(button
("class" "lowered")
("onclick" "globalThis.continue_thread(event.target, '{{ post.id }}', 'replies_{{ post.id }}', 0)")
(icon (text "chevron-down"))
(str (text "general:action.show_thread"))))
(text "{%- endif %}")
; replies
(div
("class" "flex flex_col gap_2 hidden thread")
("id" "replies_{{ post.id }}"))
(text "{%- endmacro %}")
(text "{% macro user_card(user) -%}")