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,7 +4,7 @@
(text "{% endblock %} {% block body %} {{ macros::nav() }}")
(main
("class" "flex flex-col gap-2")
("class" "flex flex_col gap_2")
(div
("class" "pillmenu")
(a
@ -42,13 +42,13 @@
(text "{{ text \"communities:tab.emojis\" }}")))
(text "{%- endif %}"))
(div
("class" "w-full flex flex-col gap-2")
("class" "w_full flex flex_col gap_2")
("data-tab" "general")
(div
("id" "manage_fields")
("class" "card lowered flex flex-col gap-2")
("class" "card lowered flex flex_col gap_2")
(div
("class" "card-nest")
("class" "card_nest")
("ui_ident" "read_access")
(div
("class" "card small")
@ -67,7 +67,7 @@
("selected" "{% if community.read_access == 'Joined' -%}true{% else %}false{%- endif %}")
(text "Joined")))))
(div
("class" "card-nest")
("class" "card_nest")
("ui_ident" "join_access")
(div
("class" "card small")
@ -90,7 +90,7 @@
("selected" "{% if community.join_access == 'Nobody' -%}true{% else %}false{%- endif %}")
(text "Nobody")))))
(div
("class" "card-nest")
("class" "card_nest")
("ui_ident" "write_access")
(div
("class" "card small")
@ -113,17 +113,17 @@
("selected" "{% if community.write_access == 'Owner' -%}true{% else %}false{%- endif %}")
(text "Owner only")))))
(div
("class" "card-nest")
("class" "card_nest")
("ui_ident" "change_title")
(div
("class" "card small")
(b
(text "{{ text \"communities:label.change_title\" }}")))
(form
("class" "card flex flex-col gap-2")
("class" "card flex flex_col gap_2")
("onsubmit" "change_title(event)")
(div
("class" "flex flex-col gap-1")
("class" "flex flex_col gap_1")
(label
("for" "new_title")
(text "{{ text \"communities:label.new_title\" }}"))
@ -139,15 +139,15 @@
(span
(text "{{ text \"general:action.save\" }}"))))))
(div
("class" "card-nest")
("class" "card_nest")
("ui_ident" "danger_zone")
(div
("class" "card small flex gap-1 items-center red")
("class" "card small flex gap_1 items_center red")
(text "{{ icon \"skull\" }}")
(b
(text "{{ text \"communities:label.danger_zone\" }}")))
(div
("class" "card flex flex-wrap gap-2")
("class" "card flex flex_wrap gap_2")
(button
("class" "red lowered")
("onclick" "delete_community()")
@ -155,7 +155,7 @@
(span
(text "{{ text \"communities:label.delete_community\" }}")))))
(div
("class" "flex gap-2 flex-wrap")
("class" "flex gap_2 flex_wrap")
(button
("onclick" "save_context()")
(text "{{ icon \"check\" }}")
@ -168,17 +168,17 @@
(span
(text "{{ text \"general:action.back\" }}")))))
(div
("class" "card lowered w-full hidden flex flex-col gap-2")
("class" "card lowered w_full hidden flex flex_col gap_2")
("data-tab" "images")
(div
("class" "card-nest")
("class" "card_nest")
("ui_ident" "change_avatar")
(div
("class" "card small")
(b
(text "{{ text \"settings:label.change_avatar\" }}")))
(form
("class" "card flex gap-2 flex-row flex-wrap items-center")
("class" "card flex gap_2 flex_row flex_wrap items_center")
("method" "post")
("enctype" "multipart/form-data")
("onsubmit" "upload_avatar(event)")
@ -187,50 +187,50 @@
("name" "file")
("type" "file")
("accept" "image/png,image/jpeg,image/avif,image/webp,image/gif")
("class" "w-content"))
("class" "w_content"))
(button
(text "{{ icon \"check\" }}"))))
(div
("class" "card-nest")
("class" "card_nest")
("ui_ident" "change_banner")
(div
("class" "card small")
(b
(text "{{ text \"settings:label.change_banner\" }}")))
(form
("class" "card flex flex-col gap-2")
("class" "card flex flex_col gap_2")
("method" "post")
("enctype" "multipart/form-data")
("onsubmit" "upload_banner(event)")
(div
("class" "flex gap-2 flex-row flex-wrap items-center")
("class" "flex gap_2 flex_row flex_wrap items_center")
(input
("id" "banner_file")
("name" "file")
("type" "file")
("accept" "image/png,image/jpeg,image/avif,image/webp")
("class" "w-content"))
("class" "w_content"))
(button
(text "{{ icon \"check\" }}")))
(span
("class" "fade")
(text "Use an image of 1100x350px for the best results.")))))
(div
("class" "card lowered w-full hidden flex flex-col gap-2")
("class" "card lowered w_full hidden flex flex_col gap_2")
("data-tab" "members")
(div
("class" "card-nest")
("class" "card_nest")
(div
("class" "card small")
(b
(text "{{ text \"communities:label.select_member\" }}")))
(form
("class" "card flex-col gap-2")
("class" "card flex_col gap_2")
("onsubmit" "select_user_from_form(event)")
(div
("class" "flex flex-col gap-1")
("class" "flex flex_col gap_1")
(div
("class" "flex flex-col gap-1")
("class" "flex flex_col gap_1")
(label
("for" "uid")
(text "{{ text \"communities:label.user_id\" }}"))
@ -244,15 +244,15 @@
(button
(text "{{ text \"communities:action.select\" }}")))))
(div
("class" "card flex flex-col gap-2 w-full")
("class" "card flex flex_col gap_2 w_full")
("id" "membership_info"))
(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 \"blocks\" }}")
(span
(text "{{ text \"mod_panel:label.permissions_level_builder\" }}")))
@ -263,23 +263,23 @@
(span
(text "{{ text \"general:action.save\" }}"))))
(div
("class" "card flex flex-col gap-2")
("class" "card flex flex_col gap_2")
("id" "permission_builder"))))
(text "{% if can_manage_channels -%}")
(div
("class" "card lowered w-full hidden flex flex-col gap-2")
("class" "card lowered w_full hidden flex flex_col gap_2")
("data-tab" "channels")
(div
("class" "card-nest")
("class" "card_nest")
(div
("class" "card small")
(b
(text "{{ text \"communities:action.create_channel\" }}")))
(form
("class" "card flex flex-col gap-2")
("class" "card flex flex_col gap_2")
("onsubmit" "create_channel_from_form(event)")
(div
("class" "flex flex-col gap-1")
("class" "flex flex_col gap_1")
(label
("for" "title")
(text "{{ text \"communities:label.name\" }}"))
@ -295,14 +295,14 @@
(text "{{ text \"communities:action.create\" }}"))))
(text "{% for channel in channels %}")
(div
("class" "card-nest")
("class" "card_nest")
(div
("class" "card small")
(b
(text "{{ channel.position }} "))
(text "{{ channel.title }}"))
(div
("class" "card flex gap-2")
("class" "card flex gap_2")
(button
("class" "red lowered small")
("onclick" "delete_channel('{{ channel.id }}')")
@ -423,22 +423,22 @@
}"))
(text "{%- endif %} {% if can_manage_emojis -%}")
(div
("class" "card lowered w-full hidden flex flex-col gap-2")
("class" "card lowered w_full hidden flex flex_col gap_2")
("data-tab" "emojis")
(text "{{ components::supporter_ad(body=\"Become a supporter to upload GIF animated emojis!\") }}")
(div
("class" "card-nest")
("class" "card_nest")
("ui_ident" "change_banner")
(div
("class" "card small flex items-center gap-2")
("class" "card small flex items_center gap_2")
(text "{{ icon \"upload\" }}")
(b
(text "{{ text \"communities:label.upload\" }}")))
(form
("class" "card flex flex-col gap-2")
("class" "card flex flex_col gap_2")
("onsubmit" "upload_emoji(event)")
(div
("class" "flex flex-col gap-1")
("class" "flex flex_col gap_1")
(label
("for" "name")
(text "{{ text \"communities:label.name\" }}"))
@ -451,7 +451,7 @@
("minlength" "2")
("maxlength" "32")))
(div
("class" "flex flex-col gap-1")
("class" "flex flex_col gap_1")
(label
("for" "file")
(text "{{ text \"communities:label.file\" }}"))
@ -460,7 +460,7 @@
("name" "file")
("type" "file")
("accept" "image/png,image/jpeg,image/avif,image/webp")
("class" "w-full")))
("class" "w_full")))
(button
(text "{{ text \"communities:action.create\" }}"))
(span
@ -469,9 +469,9 @@
height)."))))
(text "{% for emoji in emojis %}")
(div
("class" "card secondary flex flex-wrap gap-2 items-center justify-between")
("class" "card secondary flex flex_wrap gap_2 items_center justify_between")
(div
("class" "flex gap-2 items-center")
("class" "flex gap_2 items_center")
(img
("src" "/api/v1/communities/{{ community.id }}/emojis/{{ emoji.name }}")
("alt" "{{ emoji.name }}")
@ -480,7 +480,7 @@
(b
(text "{{ emoji.name }}")))
(div
("class" "flex gap-2")
("class" "flex gap_2")
(button
("class" "lowered small")
("onclick" "rename_emoji('{{ emoji.id }}')")
@ -694,7 +694,7 @@
);
// ...
element.innerHTML = `<div class=\"flex gap-2 flex-wrap\" ui_ident=\"actions\">
element.innerHTML = `<div class=\"flex gap_2 flex_wrap\" ui_ident=\"actions\">
<a target=\"_blank\" class=\"button\" href=\"/api/v1/auth/user/find/${e.target.uid.value}\">Open user profile</a>
${res.payload.role !== 33 ? `<button class=\"red lowered\" onclick=\"update_user_role('${e.target.uid.value}', 33)\">Ban</button>` : `<button class=\"lowered\" onclick=\"update_user_role('${e.target.uid.value}', 5)\">Unban</button>`}
${res.payload.role !== 65 ? `<button class=\"red lowered\" onclick=\"update_user_role('${e.target.uid.value}', 65)\">Send to review</button>` : `<button class=\"green lowered\" onclick=\"update_user_role('${e.target.uid.value}', 5)\">Accept join request</button>`}