2025-06-22 21:07:35 -04:00
|
|
|
(text "{% extends \"root.html\" %} {% block head %}")
|
|
|
|
(title
|
|
|
|
(text "Add user to stack - {{ config.name }}"))
|
|
|
|
|
|
|
|
(text "{% endblock %} {% block body %} {{ macros::nav(selected=\"\") }}")
|
|
|
|
(main
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "flex flex_col gap_2")
|
2025-06-22 21:07:35 -04:00
|
|
|
(div
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "card_nest")
|
2025-06-22 21:07:35 -04:00
|
|
|
(div
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "card small flex items_center gap_2")
|
2025-06-22 21:07:35 -04:00
|
|
|
(text "{{ components::avatar(username=add_user.username, size=\"24px\") }}")
|
|
|
|
(text "{{ components::full_username(user=add_user) }}"))
|
|
|
|
(div
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "card flex flex_col gap_2")
|
2025-06-22 21:07:35 -04:00
|
|
|
(span (text "Select a stack to add this user to:"))
|
|
|
|
(text "{% for stack in stacks %}")
|
|
|
|
(button
|
2025-08-03 23:24:57 -04:00
|
|
|
("class" "justify-start lowered w_full")
|
2025-06-22 21:07:35 -04:00
|
|
|
("onclick" "choose_stack('{{ stack.id }}')")
|
|
|
|
(icon (text "layers"))
|
|
|
|
(text "{{ stack.name }}"))
|
|
|
|
(text "{% endfor %}"))))
|
|
|
|
|
|
|
|
(script
|
|
|
|
(text "function choose_stack(id) {
|
|
|
|
fetch(`/api/v1/stacks/${id}/users`, {
|
|
|
|
method: \"POST\",
|
|
|
|
headers: {
|
|
|
|
\"Content-Type\": \"application/json\",
|
|
|
|
},
|
|
|
|
body: JSON.stringify({
|
|
|
|
username: \"{{ add_user.username }}\",
|
|
|
|
}),
|
|
|
|
})
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((res) => {
|
|
|
|
trigger(\"atto::toast\", [
|
|
|
|
res.ok ? \"success\" : \"error\",
|
|
|
|
res.message,
|
|
|
|
]);
|
|
|
|
|
|
|
|
if (res.ok) {
|
|
|
|
window.close();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}"))
|
|
|
|
|
|
|
|
(text "{% endblock %}")
|