add: more mod panel stats add: show user invite in mod panel add:

ability to share to twitter/bluesky
This commit is contained in:
trisua 2025-06-24 13:18:52 -04:00
parent 66beef6b1d
commit 2676340fba
8 changed files with 201 additions and 22 deletions

View file

@ -132,6 +132,7 @@
("class" "card flex flex-col post gap-2 post:{{ post.id }} {% if secondary -%}secondary{%- endif %}")
("data-community" "{{ post.community }}")
("data-ownsup" "{{ owner.permissions|has_supporter }}")
("data-id" "{{ post.id }}")
("hook" "verify_emojis")
(div
("class" "w-full flex gap-2")
@ -214,7 +215,7 @@
("class" "flush")
("href" "/post/{{ post.id }}")
(h2
("id" "post-content:{{ post.id }}")
("id" "post_content:{{ post.id }}")
("class" "no_p_margin post_content")
("hook" "long")
(text "{{ post.title }}"))
@ -223,7 +224,6 @@
(text "{% else %}")
(text "{% if not post.context.content_warning -%}")
(span
("id" "post-content:{{ post.id }}")
("class" "no_p_margin post_content")
("hook" "long")
@ -234,7 +234,8 @@
(text "{%- endif %}")
; content
(text "{{ post.content|markdown|safe }} {% if expect_repost -%} {% if repost -%} {{ self::post(post=repost[1], owner=repost[0], secondary=not secondary, community=false, show_community=false, can_manage_post=false) }} {% else %}")
(span ("id" "post_content:{{ post.id }}") (text "{{ post.content|markdown|safe }}"))
(text "{% if expect_repost -%} {% if repost -%} {{ self::post(post=repost[1], owner=repost[0], secondary=not secondary, community=false, show_community=false, can_manage_post=false) }} {% else %}")
(div
("class" "card lowered red flex items-center gap-2")
(text "{{ icon \"frown\" }}")
@ -251,7 +252,6 @@
(div
("class" "flex flex-col gap-2")
(span
("id" "post-content:{{ post.id }}")
("class" "no_p_margin post_content")
("hook" "long")
@ -261,7 +261,8 @@
(text "{% endif %}")
; content
(text "{{ post.content|markdown|safe }} {% if expect_repost -%} {% if repost -%} {{ self::post(post=repost[1], owner=repost[0], secondary=not secondary, community=false, show_community=false, can_manage_post=false) }} {% else %}")
(span ("id" "post_content:{{ post.id }}") (text "{{ post.content|markdown|safe }}"))
(text "{% if expect_repost -%} {% if repost -%} {{ self::post(post=repost[1], owner=repost[0], secondary=not secondary, community=false, show_community=false, can_manage_post=false) }} {% else %}")
(div
("class" "card lowered red flex items-center gap-2")
(text "{{ icon \"frown\" }}")
@ -338,7 +339,32 @@
(text "{{ icon \"quote\" }}")
(span
(text "{{ text \"communities:label.quote_post\" }}")))
(button
("onclick" "trigger('me::intent_twitter', [trigger('me::gen_share', [{ q: '{{ post.context.answering }}', p: '{{ post.id }}' }, 280, true])])")
(icon (text "bird"))
(span
(text "Twitter")))
(button
("onclick" "trigger('me::intent_bluesky', [trigger('me::gen_share', [{ q: '{{ post.context.answering }}', p: '{{ post.id }}' }, 280, true])])")
(icon (text "cloud"))
(span
(text "BlueSky")))
(text "{%- endif %}")
(text "{% if user.id != post.owner -%}")
(b
("class" "title")
(text "{{ text \"general:label.safety\" }}"))
(button
("class" "red")
("onclick" "trigger('me::report', ['{{ post.id }}', 'post'])")
(text "{{ icon \"flag\" }}")
(span
(text "{{ text \"general:action.report\" }}")))
(text "{%- endif %} {% if (user.id == post.owner) or is_helper or can_manage_post %}")
(b
("class" "title")
(text "{{ text \"general:action.manage\" }}"))
; forge stuff
(text "{% if community and community.is_forge -%} {% if post.is_open -%}")
(button
("class" "green")
@ -354,20 +380,7 @@
(span
(text "{{ text \"forge:action.reopen\" }}")))
(text "{%- endif %} {%- endif %}")
(text "{% if user.id != post.owner -%}")
(b
("class" "title")
(text "{{ text \"general:label.safety\" }}"))
(button
("class" "red")
("onclick" "trigger('me::report', ['{{ post.id }}', 'post'])")
(text "{{ icon \"flag\" }}")
(span
(text "{{ text \"general:action.report\" }}")))
(text "{%- endif %} {% if (user.id == post.owner) or is_helper or can_manage_post %}")
(b
("class" "title")
(text "{{ text \"general:action.manage\" }}"))
; owner stuff
(text "{% if user.id == post.owner -%}")
(a
("href" "/post/{{ post.id }}#/edit")
@ -675,6 +688,7 @@
(span
("class" "no_p_margin")
("style" "font-weight: 500")
("id" "question_content:{{ question.id }}")
(text "{{ question.content|markdown|safe }}"))
; question drawings
(text "{{ self::post_media(upload_ids=question.drawings) }}")

View file

@ -202,6 +202,20 @@
(text "{% for user in associations -%}")
(text "{{ components::user_plate(user=user, show_menu=false) }}")
(text "{%- endfor %}")))
(text "{% if invite -%}")
(div
("class" "card-nest w-full")
(div
("class" "card small flex items-center justify-between gap-2")
(div
("class" "flex items-center gap-2")
(text "{{ icon \"ticket\" }}")
(span
(text "{{ text \"mod_panel:label.invited_by\" }}"))))
(div
("class" "card lowered flex flex-wrap gap-2")
(text "{{ components::user_plate(user=invite[0], show_menu=false) }}")))
(text "{%- endif %}")
(div
("class" "card-nest w-full")
(div

View file

@ -29,6 +29,15 @@
(b
(text "Socket tasks: "))
(span
(text "{{ (active_users_chats + active_users) * 3 }}")))))))
(text "{{ (active_users_chats + active_users) * 3 }}"))))
(hr)
(ul
(li (b (text "Users: ")) (span (text "{{ table_users }}")))
(li (b (text "IP bans: ")) (span (text "{{ table_ipbans }}")))
(li (b (text "Invite codes: ")) (span (text "{{ table_invite_codes }}")))
(li (b (text "Posts: ")) (span (text "{{ table_posts }}")))
(li (b (text "Uploads: ")) (span (text "{{ table_uploads }}")))
(li (b (text "Communities: ")) (span (text "{{ table_communities }}")))))))
(text "{% endblock %}")