add: user ban_reason
This commit is contained in:
parent
b25bda29b8
commit
d1c3643574
11 changed files with 100 additions and 9 deletions
|
@ -102,7 +102,11 @@
|
|||
("class" "flush")
|
||||
("style" "font-weight: 600")
|
||||
("target" "_top")
|
||||
(text "{{ self::username(user=user) }}"))
|
||||
(text "{% if user.permissions|has_banned -%}")
|
||||
(del ("class" "fade") (text "{{ self::username(user=user) }}"))
|
||||
(text "{% else %}")
|
||||
(text "{{ self::username(user=user) }}")
|
||||
(text "{%- endif %}"))
|
||||
(text "{{ self::online_indicator(user=user) }} {% if user.is_verified -%}")
|
||||
(span
|
||||
("title" "Verified")
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
const ui = await ns(\"ui\");
|
||||
const element = document.getElementById(\"mod_options\");
|
||||
|
||||
async function profile_request(do_confirm, path, body) {
|
||||
globalThis.profile_request = async (do_confirm, path, body) => {
|
||||
if (do_confirm) {
|
||||
if (
|
||||
!(await trigger(\"atto::confirm\", [
|
||||
|
@ -273,6 +273,33 @@
|
|||
("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
|
||||
("class" "card small flex items-center justify-between gap-2")
|
||||
(div
|
||||
("class" "flex items-center gap-2")
|
||||
(icon (text "scale"))
|
||||
(span
|
||||
(str (text "mod_panel:label.ban_reason")))))
|
||||
(form
|
||||
("class" "card flex flex-col gap-2")
|
||||
("onsubmit" "event.preventDefault(); profile_request(false, 'ban_reason', { reason: event.target.reason.value || '' })")
|
||||
(div
|
||||
("class" "flex flex-col gap-1")
|
||||
(label
|
||||
("for" "title")
|
||||
(str (text "mod_panel:label.ban_reason")))
|
||||
(textarea
|
||||
("type" "text")
|
||||
("name" "reason")
|
||||
("id" "reason")
|
||||
("placeholder" "ban reason")
|
||||
("minlength" "2")
|
||||
(text "{{ profile.ban_reason|remove_script_tags|safe }}")))
|
||||
(button
|
||||
("class" "primary")
|
||||
(str (text "general:action.save")))))
|
||||
(div
|
||||
("class" "card-nest w-full")
|
||||
(div
|
||||
|
|
|
@ -70,8 +70,13 @@
|
|||
(str (text "general:label.account_banned")))
|
||||
|
||||
(div
|
||||
("class" "card")
|
||||
(str (text "general:label.account_banned_body"))))))
|
||||
("class" "card flex flex-col gap-2 no_p_margin")
|
||||
(str (text "general:label.account_banned_body"))
|
||||
(hr)
|
||||
(span ("class" "fade") (text "The following reason was provided by a moderator:"))
|
||||
(div
|
||||
("class" "card lowered w-full")
|
||||
(text "{{ user.ban_reason|markdown|safe }}"))))))
|
||||
|
||||
; if we aren't banned, just show the page body
|
||||
(text "{% elif user and user.awaiting_purchase %}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue