mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-17 01:15:05 +03:00
Akif9748
4be2069587
Co-authored-by: Sapphire1525 <Sapphire1525@users.noreply.github.com> Co-authored-by: inoaa79 <inoaa79@users.noreply.github.com>
85 lines
No EOL
1.9 KiB
Text
85 lines
No EOL
1.9 KiB
Text
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<%- include("extra/header", { title: member.name }) %>
|
|
|
|
<body>
|
|
|
|
<%- include("extra/navbar", { user }) %>
|
|
|
|
|
|
<ul>
|
|
<li>
|
|
<h1>Avatar:</h1>
|
|
<img style="width:256px;height:256px;" src=<%=member.avatar %> alt=<%= member.name %>>
|
|
</li>
|
|
|
|
<li>
|
|
<h2>Name: <%= member.name %>
|
|
</h2>
|
|
</li>
|
|
<li>
|
|
<h2>Created at:
|
|
<%= new Date(member.time).toLocaleString() %>
|
|
</h2>
|
|
|
|
|
|
</li>
|
|
<li>
|
|
<h2>Is admin? <%= member.admin ? "Yes" : "No" %>
|
|
</h2>
|
|
</li>
|
|
|
|
<li>
|
|
<h2> Message: <%= counts.message %>
|
|
</h2>
|
|
</li>
|
|
<li>
|
|
<h2> Thread: <%= counts.thread %>
|
|
</h2>
|
|
</li>
|
|
</ul>
|
|
|
|
<% if (user?.admin && !member.deleted) {%>
|
|
<form id="admin">
|
|
<button class="big" type="submit">Give admin permissions!</button>
|
|
</form>
|
|
|
|
<form id="delete">
|
|
<button class="big" type="submit">Delete user!</button>
|
|
</form>
|
|
|
|
<script type="module">
|
|
|
|
import request from "../../js/request.js";
|
|
|
|
document.addEventListener("submit", async e => {
|
|
e.preventDefault();
|
|
|
|
if (e.target.id == "admin") {
|
|
|
|
const response = await request("/api/users/<%= member.id %>/admin");
|
|
|
|
if (response.admin)
|
|
return alert("Making admin of " + response.name + " is success!");
|
|
|
|
}
|
|
|
|
const response = await request("/api/users/<%= member.id %>/delete");
|
|
|
|
if (response.deleted)
|
|
alert("User Deleted");
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
<% }; %>
|
|
<% if (member.deleted) {%>
|
|
<h1>This user has been deleted!</h1>
|
|
<% }; %>
|
|
|
|
<%- include("extra/footer") %>
|
|
</body>
|
|
|
|
</html> |