user replaced with new theme

This commit is contained in:
Akif9748 2022-08-26 20:36:04 +03:00
parent 6997aff2a8
commit 9cacdb7d65
4 changed files with 74 additions and 79 deletions

View File

@ -33,7 +33,7 @@ And, you can learn about API in `util/APIDOCS.md`.
## Roadmap ## Roadmap
### TO-DO: ### TO-DO:
- If thread deleted, not show its messages in API. - If thread deleted, not show its messages in API.
- If redirect => /register, return
### Frontend ### Frontend
### User ### User
| To do | Is done? | Priority | | To do | Is done? | Priority |

View File

@ -1,9 +1,9 @@
.title{ .title {
color: #4d18e6; color: #4d18e6;
font-weight:700; font-weight: 700;
} }
form{ form {
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
@ -12,15 +12,13 @@ form{
} }
.input{ .input {
padding: 8px 10px; padding: 8px 10px;
font-family: inherit; font-family: inherit;
display: block; display: block;
font-weight: 600; font-weight: 600;
color: #4c4c4c; color: #4c4c4c;
width: 500px; width: 500px;
margin-bottom: 10px; margin-bottom: 10px;
border: 2px solid #d9d9d9; border: 2px solid #d9d9d9;
} }

View File

@ -3,7 +3,7 @@
<%- include("extra/meta", {title: "Register!" }) %> <%- include("extra/meta", {title: "Register!" }) %>
<link rel="stylesheet" href="/css/login.css" /> <link rel="stylesheet" href="/css/login.css" />
<body style="text-align: center;"> <body style="text-align: center;">
<%- include("extra/navbar") %> <%- include("extra/navbar") %>

View File

@ -1,85 +1,82 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<%- include("extra/old_header", { title: member.name }) %> <%- include("extra/meta", {title: "User list!" }) %>
<body>
<%- include("extra/old_navbar", { user }) %>
<ul> <body style="text-align: center;">
<li> <%- include("extra/navbar") %>
<h1>Avatar:</h1>
<img style="width:256px;height:256px;" src=<%=member.avatar %> alt=<%= member.name %>>
</li>
<li> <ul>
<h2>Name: <%= member.name %> <li>
</h2> <h1 style="color: #4d18e6;">Avatar:</h1>
</li> <img style="width:256px;height:256px;" src=<%=member.avatar %> alt=<%= member.name %>>
<li> </li>
<h2>Created at:
<%= new Date(member.time).toLocaleString() %> <li>
</h2> <h2 style="color: #606060;">Name: <%= member.name %>
</h2>
</li>
<li>
<h2 style="color: #606060;">Created at:
<%= new Date(member.time).toLocaleString() %>
</h2>
</li> </li>
<li> <li>
<h2>Is admin? <%= member.admin ? "Yes" : "No" %> <h2 style="color: #606060;">Is admin? <%= member.admin ? "Yes" : "No" %>
</h2> </h2>
</li> </li>
<li> <li>
<h2> Message: <%= counts.message %> <h2 style="color: #606060;"> Message: <%= counts.message %>
</h2> </h2>
</li> </li>
<li> <li>
<h2> Thread: <%= counts.thread %> <h2 style="color: #606060;"> Thread: <%= counts.thread %>
</h2> </h2>
</li> </li>
</ul> </ul>
<% if (user?.admin && !member.deleted) {%> <% if (user?.admin && !member.deleted) {%>
<form id="admin"> <form id="admin">
<button class="big" type="submit">Give admin permissions!</button> <button class="big" type="submit">Give admin permissions!</button>
</form> </form>
<form id="delete"> <form id="delete">
<button class="big" type="submit">Delete user!</button> <button class="big" type="submit">Delete user!</button>
</form> </form>
<script type="module"> <script type="module">
import request from "../../js/request.js"; import request from "../../js/request.js";
document.addEventListener("submit", async e => { document.addEventListener("submit", async e => {
e.preventDefault(); e.preventDefault();
if (e.target.id == "admin") { if (e.target.id == "admin") {
const response = await request("/api/users/<%= member.id %>/admin"); const response = await request("/api/users/<%= member.id %>/admin");
if (response.admin)
return alert("Making admin of " + response.name + " is success!");
} 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) {%> </body>
<h1>This user has been deleted!</h1>
<% }; %>
<%- include("extra/old_footer") %>
</body>
</html> </html>