add: forum posts timeline

This commit is contained in:
trisua 2025-08-04 14:24:25 -04:00
parent 8c779b2f2e
commit d4ff681310
10 changed files with 159 additions and 17 deletions

View file

@ -1,11 +1,10 @@
(text "{% extends \"root.html\" %} {% block head %}")
(title
(text "Latest posts - {{ config.name }}"))
(text "{% endblock %} {% block body %} {{ macros::nav() }}")
(main
("class" "flex flex_col gap_2")
(text "{{ macros::timelines_nav(selected=\"all\", posts=\"/all\", questions=\"/all/questions\") }} {% if not user -%}")
(text "{{ macros::timelines_nav(selected=\"all\", posts=\"/all\", questions=\"/all/questions\", forum_posts=\"/all/forum_posts\") }} {% if not user -%}")
(div
("class" "card_nest")
(div
@ -32,11 +31,9 @@
("class" "card w_full flex flex_col gap_2")
("ui_ident" "io_data_load")
(div ("ui_ident" "io_data_marker"))))
(text "{% set paged = user and user.settings.paged_timelines %}")
(script
(text "setTimeout(() => {
trigger(\"ui::io_data_load\", [\"/_swiss_army_timeline?tl=AllPosts&before=$1$&page=\", Number.parseInt(\"{{ page }}\") - 1, \"{{ paged }}\" === \"true\"]);
});"))
(text "{% endblock %}")

View file

@ -0,0 +1,24 @@
(text "{% extends \"root.html\" %} {% block head %}")
(title
(text "Latest forum posts - {{ config.name }}"))
(text "{% endblock %} {% block body %} {{ macros::nav() }}")
(main
("class" "flex flex_col gap_2")
(text "{{ macros::timelines_nav(selected=\"all\", posts=\"/all\", questions=\"/all/questions\", secondary_selected=\"forum_posts\", forum_posts=\"/all/forum_posts\") }}")
(div
("class" "card w_full flex flex_col gap_2")
(div
("class" "w_full")
("style" "overflow: auto")
(table
("class" "w_full")
(thead
(th (text "In"))
(th (text "Title"))
(th (text "Replies"))
(th (text "Score"))
(th (text "Created")))
(tbody
(text "{% for post in feed %} {{ components::topic_post_display(post=post[0], owner=post[1], community=post[2]) }} {% endfor %}"))))
(text "{{ components::pagination(page=page, items=feed|length) }}")))
(text "{% endblock %}")

View file

@ -1,13 +1,11 @@
(text "{% extends \"root.html\" %} {% block head %}")
(title
(text "Latest questions - {{ config.name }}"))
(text "{% endblock %} {% block body %} {{ macros::nav() }}")
(main
("class" "flex flex_col gap_2")
(text "{{ macros::timelines_nav(selected=\"all\", posts=\"/all\", questions=\"/all/questions\", secondary_selected=\"questions\") }}")
(text "{{ macros::timelines_nav(selected=\"all\", posts=\"/all\", questions=\"/all/questions\", secondary_selected=\"questions\", forum_posts=\"/all/forum_posts\") }}")
(div
("class" "card w_full flex flex_col gap_2")
(text "{% for question in list %} {{ components::global_question(question=question, can_manage_questions=false, secondary=true) }} {% endfor %} {{ components::pagination(page=page, items=list|length) }}")))
(text "{% endblock %}")