Update user.ejs

This commit is contained in:
tokmak0 2022-08-28 18:10:41 +03:00 committed by GitHub
parent 14bf6d45a4
commit 8b91d8d182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 96 additions and 82 deletions

View File

@ -3,42 +3,57 @@
<%- include("extra/meta", {title: member.name }) %>
<link rel="stylesheet" href="/css/user.css" />
<body style="text-align: center;">
<body >
<%- include("extra/navbar") %>
<ul>
<li>
<h1 style="color: #4d18e6;">Avatar:</h1>
<img style="width:256px;height:256px;" src="<%=member.avatar %>">
</li>
<li>
<h2 style="color: #606060;">Name: <%= member.name %>
<div class="content">
<div class="box" style="justify-content:center;">
<img style="width:100px;height:100px;border-radius:50%;" src="<%=member.avatar %>">
</div>
<div class="box">
<h2 class="box-title">Name: <%= member.name %>
</h2>
</li>
<li>
<h2 style="color: #606060;">Created at:
<h2 class="box-title">
<%= member.name %>
</h2>
</div>
<div class="box">
<h2 class="box-title">Created at:
</h2>
<h2 class="box-title">
<%= new Date(member.time).toLocaleString() %>
</h2>
</div>
<div class="box">
</li>
<li>
<h2 style="color: #606060;">Is admin? <%= member.admin ? "Yes" : "No" %>
<h2 class="box-title">Is admin?
</h2>
</li>
<li>
<h2 style="color: #606060;"> Message: <%= counts.message %>
<h2 class="box-title">
<%= member.admin ? "Yes" : "No" %>
</h2>
</li>
<li>
<h2 style="color: #606060;"> Thread: <%= counts.thread %>
</h2>
</li>
</ul>
</div>
<div class="box">
<h2 class="box-title"> Message:
</h2>
<h2 class="box-title">
<%= counts.message %>
</h2>
</div>
<div class="box">
<h2 class="box-title"> Thread:
</h2>
<h2 class="box-title">
<%= counts.thread %>
</h2>
</div>
</div>
<% if (user?.admin && !member.deleted) {%>
<a class="big" id="admin">Give admin permissions!</a>
@ -56,14 +71,13 @@
if (response.admin)
return alert("Making admin of " + response.name + " is success!");
} else if (e.target.id == "delete") {
}
const response = await request("/api/users/<%= member.id %>/delete");
if (!response.deleted) return;
if (!response.deleted) return
alert("User is deleted!");
location.reload()
}
});
@ -92,6 +106,6 @@
</script>
<% }; %>
</body>
</body>
</html>