mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-22 20:10:40 +03:00
76 lines
No EOL
2.2 KiB
Text
76 lines
No EOL
2.2 KiB
Text
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<%- include("extra/meta", {title: member.name }) %>
|
|
|
|
|
|
<body>
|
|
<link rel="stylesheet" href="/css/user.css" />
|
|
<%if (user) {%>
|
|
<script type="module">
|
|
import request from "../../js/request.js";
|
|
document.addEventListener("click", async e => {
|
|
if (e.target.id == "delete") {
|
|
const response = await request("/api/users/<%= member.id %>", "DELETE");
|
|
if (!response.deleted) return
|
|
alert("User is deleted!");
|
|
location.reload()
|
|
} else if (e.target.id == "undelete") {
|
|
const response = await request("/api/users/<%= member.id %>/undelete");
|
|
if (response.deleted) return;
|
|
alert("User is undeleted successfully!");
|
|
location.reload()
|
|
}
|
|
});
|
|
</script>
|
|
<% }; %>
|
|
<%- include("extra/navbar") %>
|
|
|
|
<div class="content">
|
|
|
|
<% if (user?.admin || user?.id === member.id) { %>
|
|
<a class="btn-outline-primary" href="<%= member.getLink() %>/edit">Edit user!</a>
|
|
<% } %>
|
|
|
|
<% if (member.deleted) {%>
|
|
<h1>This user has been deleted!</h1>
|
|
<a id="undelete" class="btn-primary">Undelete user! </a>
|
|
<% } else if (user?.admin){ %>
|
|
<a id="delete" class="btn-outline-primary">Delete user! </a>
|
|
<% }; %>
|
|
|
|
|
|
<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:</h2>
|
|
<h2 class="box-value"><%= member.name %></h2>
|
|
</div>
|
|
<div class="box">
|
|
<h2 class="box-title">Created at:</h2>
|
|
<h2 class="box-value"><%= new Date(member.time).toLocaleString() %></h2>
|
|
</div>
|
|
<div class="box">
|
|
<h2 class="box-title">Is admin?</h2>
|
|
<h2 class="box-value"><%= member.admin ? "Yes" : "No" %></h2>
|
|
</div>
|
|
<div class="box">
|
|
<h2 class="box-title">Message:</h2>
|
|
<h2 class="box-value"><%= counts.message %></h2>
|
|
</div>
|
|
<div class="box">
|
|
<h2 class="box-title">Thread:</h2>
|
|
<h2 class="box-value"><%= counts.thread %></h2>
|
|
</div>
|
|
<div class="box">
|
|
<h2 class="box-title">About:</h2>
|
|
</div>
|
|
<p class="box-value">
|
|
<%= member.about %>
|
|
</p>
|
|
|
|
</div>
|
|
</body>
|
|
|
|
</html> |