add: forum posts ui

This commit is contained in:
trisua 2025-08-03 23:24:57 -04:00
parent ef029c59b3
commit 2be87c397d
90 changed files with 1459 additions and 1299 deletions

View file

@ -4,19 +4,19 @@
(text "{% endblock %} {% block body %} {{ macros::nav(selected=\"communities\") }}")
(main
("class" "flex flex-col gap-2")
("class" "flex flex_col gap_2")
(text "{% if user -%}")
(div
("class" "card-nest")
("class" "card_nest")
(div
("class" "card small")
(b
(text "{{ text \"communities:label.create_new\" }}")))
(form
("class" "card flex flex-col gap-2")
("class" "card flex flex_col gap_2")
("onsubmit" "create_community_from_form(event)")
(div
("class" "flex flex-col gap-1")
("class" "flex flex_col gap_1")
(label
("for" "title")
(text "{{ text \"communities:label.name\" }}"))
@ -28,21 +28,31 @@
("required" "")
("minlength" "2")
("maxlength" "32")))
(label
("for" "is_forum")
("class" "flex items_center gap_2")
(input
("type" "checkbox")
("id" "is_forum")
("name" "is_forum")
("class" "w_content"))
(span
(text "Is forum")))
(button
(text "{{ text \"communities:action.create\" }}"))))
(text "{% if list|length >= 4 -%} {{ components::supporter_ad(body=\"Become a supporter to create up to 10 communities!\") }} {%- endif %} {%- endif %}")
(div
("class" "card-nest w-full")
("class" "card_nest w_full")
(div
("class" "card small flex items-center justify-between gap-2")
("class" "card small flex items_center justify_between gap_2")
(div
("class" "flex items-center gap-2")
("class" "flex items_center gap_2")
(text "{{ icon \"award\" }}")
(span
(text "{{ text \"communities:label.my_communities\" }}")))
(div
("class" "flex items-center gap-2")
("class" "flex items_center gap_2")
(a
("href" "/forges")
("class" "button lowered small")
@ -58,17 +68,17 @@
("class" "desktop")
(text "{{ text \"communities:label.join_new\" }}")))))
(div
("class" "card flex flex-col gap-2")
("class" "card flex flex_col gap_2")
(text "{% for item in list %} {{ components::community_listing_card(community=item) }} {% endfor %}")))
(div
("class" "card-nest w-full")
("class" "card_nest w_full")
(div
("class" "card small flex items-center gap-2")
("class" "card small flex items_center gap_2")
(text "{{ icon \"trending-up\" }}")
(span
(text "{{ text \"communities:label.popular_communities\" }}")))
(div
("class" "card flex flex-col gap-2")
("class" "card flex flex_col gap_2")
(text "{% for item in popular_list %} {{ components::community_listing_card(community=item) }} {% endfor %}"))))
(script
@ -83,6 +93,7 @@
},
body: JSON.stringify({
title: e.target.title.value,
forum: e.target.is_forum.checked,
}),
})
.then((res) => res.json())