mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-29 14:10:41 +03:00
user replaced with new theme
This commit is contained in:
parent
6997aff2a8
commit
9cacdb7d65
4 changed files with 74 additions and 79 deletions
|
@ -33,7 +33,7 @@ And, you can learn about API in `util/APIDOCS.md`.
|
|||
## Roadmap
|
||||
### TO-DO:
|
||||
- If thread deleted, not show its messages in API.
|
||||
|
||||
- If redirect => /register, return
|
||||
### Frontend
|
||||
### User
|
||||
| To do | Is done? | Priority |
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
.title{
|
||||
color: #4d18e6;
|
||||
font-weight:700;
|
||||
.title {
|
||||
color: #4d18e6;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
form{
|
||||
form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
@ -12,15 +12,13 @@ form{
|
|||
}
|
||||
|
||||
|
||||
.input{
|
||||
padding: 8px 10px;
|
||||
font-family: inherit;
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: #4c4c4c;
|
||||
width: 500px;
|
||||
margin-bottom: 10px;
|
||||
border: 2px solid #d9d9d9;
|
||||
}
|
||||
|
||||
|
||||
.input {
|
||||
padding: 8px 10px;
|
||||
font-family: inherit;
|
||||
display: block;
|
||||
font-weight: 600;
|
||||
color: #4c4c4c;
|
||||
width: 500px;
|
||||
margin-bottom: 10px;
|
||||
border: 2px solid #d9d9d9;
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<%- include("extra/meta", {title: "Register!" }) %>
|
||||
|
||||
<link rel="stylesheet" href="/css/login.css" />
|
||||
<link rel="stylesheet" href="/css/login.css" />
|
||||
|
||||
<body style="text-align: center;">
|
||||
<%- include("extra/navbar") %>
|
||||
|
|
119
views/user.ejs
119
views/user.ejs
|
@ -1,85 +1,82 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<%- include("extra/old_header", { title: member.name }) %>
|
||||
|
||||
<body>
|
||||
|
||||
<%- include("extra/old_navbar", { user }) %>
|
||||
<%- include("extra/meta", {title: "User list!" }) %>
|
||||
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<h1>Avatar:</h1>
|
||||
<img style="width:256px;height:256px;" src=<%=member.avatar %> alt=<%= member.name %>>
|
||||
</li>
|
||||
<body style="text-align: center;">
|
||||
<%- include("extra/navbar") %>
|
||||
|
||||
<li>
|
||||
<h2>Name: <%= member.name %>
|
||||
</h2>
|
||||
</li>
|
||||
<li>
|
||||
<h2>Created at:
|
||||
<%= new Date(member.time).toLocaleString() %>
|
||||
</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<h1 style="color: #4d18e6;">Avatar:</h1>
|
||||
<img style="width:256px;height:256px;" src=<%=member.avatar %> alt=<%= member.name %>>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<h2 style="color: #606060;">Name: <%= member.name %>
|
||||
</h2>
|
||||
</li>
|
||||
<li>
|
||||
<h2 style="color: #606060;">Created at:
|
||||
<%= new Date(member.time).toLocaleString() %>
|
||||
</h2>
|
||||
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<h2>Is admin? <%= member.admin ? "Yes" : "No" %>
|
||||
</h2>
|
||||
</li>
|
||||
</li>
|
||||
<li>
|
||||
<h2 style="color: #606060;">Is admin? <%= member.admin ? "Yes" : "No" %>
|
||||
</h2>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<h2> Message: <%= counts.message %>
|
||||
</h2>
|
||||
</li>
|
||||
<li>
|
||||
<h2> Thread: <%= counts.thread %>
|
||||
</h2>
|
||||
</li>
|
||||
</ul>
|
||||
<li>
|
||||
<h2 style="color: #606060;"> Message: <%= counts.message %>
|
||||
</h2>
|
||||
</li>
|
||||
<li>
|
||||
<h2 style="color: #606060;"> Thread: <%= counts.thread %>
|
||||
</h2>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<% if (user?.admin && !member.deleted) {%>
|
||||
<form id="admin">
|
||||
<button class="big" type="submit">Give admin permissions!</button>
|
||||
</form>
|
||||
<% 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>
|
||||
<form id="delete">
|
||||
<button class="big" type="submit">Delete user!</button>
|
||||
</form>
|
||||
|
||||
<script type="module">
|
||||
<script type="module">
|
||||
|
||||
import request from "../../js/request.js";
|
||||
import request from "../../js/request.js";
|
||||
|
||||
document.addEventListener("submit", async e => {
|
||||
e.preventDefault();
|
||||
document.addEventListener("submit", async e => {
|
||||
e.preventDefault();
|
||||
|
||||
if (e.target.id == "admin") {
|
||||
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 %>/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");
|
||||
}
|
||||
|
||||
});
|
||||
const response = await request("/api/users/<%= member.id %>/delete");
|
||||
|
||||
if (response.deleted)
|
||||
alert("User Deleted");
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</script>
|
||||
<% }; %>
|
||||
<% if (member.deleted) {%>
|
||||
<h1>This user has been deleted!</h1>
|
||||
<% }; %>
|
||||
<% if (member.deleted) {%>
|
||||
<h1>This user has been deleted!</h1>
|
||||
<% }; %>
|
||||
|
||||
<%- include("extra/old_footer") %>
|
||||
</body>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue