2025-06-01 12:25:33 -04:00
|
|
|
(text "{% extends \"root.html\" %} {% block head %}")
|
|
|
|
(title
|
|
|
|
(text "{{ profile.username }} (blocked) - {{ config.name }}"))
|
|
|
|
|
|
|
|
(text "{% endblock %} {% block body %} {{ macros::nav() }}")
|
|
|
|
(main
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "flex flex_col gap_2")
|
2025-06-01 12:25:33 -04:00
|
|
|
(div
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "card_nest")
|
2025-06-01 12:25:33 -04:00
|
|
|
(div
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "card small flex items_center justify_between gap_2")
|
2025-06-01 12:25:33 -04:00
|
|
|
(div
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "flex items_center gap_2")
|
2025-08-23 15:36:26 -04:00
|
|
|
(text "{{ components::avatar(id=profile.id, size=\"24px\") }}")
|
2025-06-01 12:25:33 -04:00
|
|
|
(span
|
|
|
|
(text "{{ profile.username }}")))
|
|
|
|
(b
|
|
|
|
("class" "notification chip")
|
|
|
|
(text "{{ text \"auth:label.blocked_profile\" }}")))
|
|
|
|
(div
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "card flex flex_col gap_2")
|
2025-06-01 12:25:33 -04:00
|
|
|
(span
|
|
|
|
(text "{{ text \"auth:label.blocked_profile_message\" }}"))
|
|
|
|
(div
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "card w_full secondary flex gap_2")
|
2025-06-01 12:25:33 -04:00
|
|
|
(text "{% if user -%} {% if not is_blocking -%}")
|
2025-06-28 13:33:25 -04:00
|
|
|
(div
|
|
|
|
("class" "dropdown")
|
|
|
|
(button
|
|
|
|
("onclick" "trigger('atto::hooks::dropdown', [event])")
|
|
|
|
("exclude" "dropdown")
|
|
|
|
("class" "lowered red")
|
2025-07-13 17:54:12 -04:00
|
|
|
(icon_class (text "chevron-down") (text "dropdown_arrow"))
|
2025-06-28 13:33:25 -04:00
|
|
|
(str (text "auth:action.block")))
|
|
|
|
(div
|
|
|
|
("class" "inner left")
|
|
|
|
(button
|
|
|
|
("onclick" "toggle_block_user()")
|
|
|
|
(icon (text "shield"))
|
|
|
|
(str (text "auth:action.block")))
|
|
|
|
(button
|
|
|
|
("onclick" "ip_block_user()")
|
|
|
|
(icon (text "wifi"))
|
|
|
|
(str (text "auth:action.ip_block")))))
|
2025-06-01 12:25:33 -04:00
|
|
|
(text "{% else %}")
|
|
|
|
(button
|
|
|
|
("onclick" "toggle_block_user()")
|
2025-06-12 13:53:23 -04:00
|
|
|
("class" "lowered red")
|
2025-06-01 12:25:33 -04:00
|
|
|
(text "{{ icon \"shield-off\" }}")
|
|
|
|
(span
|
|
|
|
(text "{{ text \"auth:action.unblock\" }}")))
|
|
|
|
(text "{%- endif %}")
|
|
|
|
(script
|
|
|
|
(text "globalThis.toggle_block_user = async () => {
|
|
|
|
if (
|
|
|
|
!(await trigger(\"atto::confirm\", [
|
|
|
|
\"Are you sure you would like to do this?\",
|
|
|
|
]))
|
|
|
|
) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
fetch(\"/api/v1/auth/user/{{ profile.id }}/block\", {
|
|
|
|
method: \"POST\",
|
|
|
|
})
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((res) => {
|
|
|
|
trigger(\"atto::toast\", [
|
|
|
|
res.ok ? \"success\" : \"error\",
|
|
|
|
res.message,
|
|
|
|
]);
|
|
|
|
});
|
2025-06-28 13:33:25 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
globalThis.ip_block_user = async () => {
|
|
|
|
if (
|
|
|
|
!(await trigger(\"atto::confirm\", [
|
|
|
|
\"Are you sure you would like to do this?\",
|
|
|
|
]))
|
|
|
|
) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
fetch(
|
|
|
|
\"/api/v1/auth/user/{{ profile.id }}/block_ip\",
|
|
|
|
{
|
|
|
|
method: \"POST\",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((res) => {
|
|
|
|
trigger(\"atto::toast\", [
|
|
|
|
res.ok ? \"success\" : \"error\",
|
|
|
|
res.message,
|
|
|
|
]);
|
|
|
|
});
|
2025-06-01 12:25:33 -04:00
|
|
|
};"))
|
|
|
|
(text "{%- endif %}")
|
|
|
|
(a
|
|
|
|
("href" "/")
|
2025-06-12 13:53:23 -04:00
|
|
|
("class" "button red lowered")
|
2025-06-01 12:25:33 -04:00
|
|
|
(text "{{ icon \"x\" }}")
|
|
|
|
(span
|
|
|
|
(text "{{ text \"general:action.back\" }}")))))))
|
|
|
|
|
|
|
|
(text "{% endblock %}")
|