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

@ -6,7 +6,7 @@
(nav
("class" "chats_nav")
(button
("class" "flex gap-2 items-center active")
("class" "flex gap_2 items_center active")
("onclick" "toggle_sidebars(event)")
(text "{{ icon \"panel-left\" }} {% if community -%}")
(b
@ -19,7 +19,7 @@
(div
("class" "flex")
(div
("class" "sidebar flex flex-col items-center gap-2")
("class" "sidebar flex flex_col items_center gap_2")
("id" "community_list")
("style" "width: var(--list-bar-width)")
(a
@ -35,12 +35,12 @@
(text "{{ components::community_avatar(id=community.id, community=community, size=\"48px\") }}"))
(text "{%- endif %} {% endfor %}"))
(div
("class" "sidebar flex flex-col gap-2 justify-between")
("class" "sidebar flex flex_col gap_2 justify_between")
("id" "channels_list")
(div
("class" "flex flex-col gap-2 w-full")
("class" "flex flex_col gap_2 w_full")
(div
("class" "title flex items-center justify-between channel_header")
("class" "title flex items_center justify_between channel_header")
(text "{% if community -%}")
(b
("class" "name shorter")
@ -73,7 +73,7 @@
(text "{%- endif %}"))
(text "{% if can_manage_channels -%}")
(a
("class" "button w-full justify-start lowered")
("class" "button w_full justify-start lowered")
("href" "/community/{{ selected_community }}/manage#/channels")
(text "{{ icon \"plus\" }}")
(span
@ -86,14 +86,14 @@
(text "{{ components::user_plate(user=user, show_menu=true) }}"))
(text "{% if channel -%}")
(div
("class" "w-full flex flex-col gap-2 padded_section")
("class" "w_full flex flex_col gap_2 padded_section")
("id" "stream")
("style" "padding: var(--pad-4)")
(turbo-frame
("id" "stream_body_frame")
("src" "/chats/{{ selected_community }}/{{ selected_channel }}/_stream?page={{ page }}&message={{ message }}"))
(form
("class" "card flex flex-row gap-2")
("class" "card flex flex_row gap_2")
("onsubmit" "create_message_from_form(event)")
(textarea
("type" "text")

View file

@ -2,12 +2,12 @@
(turbo-frame
("id" "channels_list_frame")
(div
("class" "channels_list_half flex flex-col gap-2 {% if selected_community != 0 or selected_channel == 0%}no_members{%- endif -%}")
("class" "channels_list_half flex flex_col gap_2 {% if selected_community != 0 or selected_channel == 0%}no_members{%- endif -%}")
(text "{% for channel in channels %}")
(div
("class" "flex flex-row gap-1")
("class" "flex flex_row gap_1")
(a
("class" "w-full justify-start button {% if selected_channel == channel.id -%}lowered{% else %}camo{%- endif %}")
("class" "w_full justify-start button {% if selected_channel == channel.id -%}lowered{% else %}camo{%- endif %}")
("href" "/chats/{{ selected_community }}/{{ channel.id }}")
("data-turbo" "{{ selected_community == '0' }}")
(text "{{ icon \"rss\" }}")
@ -71,6 +71,6 @@
(text "{% endfor %}"))
(text "{% if selected_community == 0 and selected_channel -%}")
(div
("class" "members_list_half flex flex-col gap-2")
("class" "members_list_half flex flex_col gap_2")
(text "{% for member in members %} {{ components::user_plate(user=member, show_kick=user.id == channel.owner) }} {% endfor %}"))
(text "{%- endif %}"))

View file

@ -2,11 +2,11 @@
(turbo-frame
("id" "stream_body_frame")
(div
("class" "gap-2")
("class" "gap_2")
("id" "stream_body")
(text "{% if page != 0 -%}")
(div
("class" "card flex gap-2 small lowered flex-wrap")
("class" "card flex gap_2 small lowered flex_wrap")
(b
(text "{{ text \"chats:label.viewing_old_messages\" }}"))
(a
@ -16,7 +16,7 @@
(text "{{ text \"chats:label.go_back\" }}")))
(text "{%- endif %} {% if message -%}")
(div
("class" "card flex gap-2 small lowered flex-wrap")
("class" "card flex gap_2 small lowered flex_wrap")
(b
(text "{{ text \"chats:label.viewing_single_message\" }}"))
(a
@ -27,7 +27,7 @@
(text "{{ text \"chats:label.go_back\" }}")))
(text "{{ components::message(user=message_owner, message=message, grouped=false) }} {% else %} {% for message in messages %} {{ components::message(user=message[1], message=message[0], grouped=message[2]) }} {% endfor %} {%- endif %} {% if messages|length > 0 -%}")
(div
("class" "flex gap-2 w-full justify-center")
("class" "flex gap_2 w_full justify_center")
(a
("class" "button")
("href" "/chats/{{ community }}/{{ channel.id }}/_stream?page={{ page + 1 }}")