mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-26 05:10:41 +03:00
Delete thread button for threads page
This commit is contained in:
parent
3fef090992
commit
c268a5bed8
5 changed files with 19 additions and 15 deletions
|
@ -45,12 +45,10 @@ Akf-forum has got an API for AJAX, other clients etc. And, you can learn about A
|
|||
- page for threads - users
|
||||
- extra ratelimits
|
||||
- better edits
|
||||
- IP BAN fix
|
||||
- IP BAN fix, user -> ips []
|
||||
- message counts for API
|
||||
- ZATEN SİLİNDİ BU KİŞİ & MESAJ
|
||||
- delete thread for threads area
|
||||
- delete admin request, moreover, add it to user patch delete 😳
|
||||
- user -> ips []
|
||||
|
||||
### API
|
||||
| To do | Is done?
|
||||
|
|
|
@ -52,7 +52,8 @@ a {
|
|||
.btn-danger {
|
||||
color: #e8e8e8;
|
||||
background-color: #ff0000;
|
||||
padding: 10px 20px 10px 20px;
|
||||
padding: 0px 10px 0px 10px;
|
||||
|
||||
border-radius: 4px;
|
||||
font-weight: 700;
|
||||
margin: 10px;
|
||||
|
@ -83,9 +84,10 @@ a {
|
|||
.btn-outline-primary:hover {
|
||||
border: 2px solid #4d18e6;
|
||||
}
|
||||
.btn-danger:hover{
|
||||
background-color: #d01919;
|
||||
border: 2px solid #d01919;
|
||||
|
||||
.btn-danger:hover {
|
||||
background-color: #d01919;
|
||||
border: 2px solid #d01919;
|
||||
}
|
||||
|
||||
|
||||
|
@ -95,6 +97,7 @@ border: 2px solid #d01919;
|
|||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
padding: 10px;
|
||||
font-weight: 700;
|
||||
|
@ -143,7 +146,7 @@ div.avatar {
|
|||
|
||||
.box-username {
|
||||
display: flex;
|
||||
align-items:center;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
|
|
|
@ -16,8 +16,8 @@ app.get("/:id", async (req, res) => {
|
|||
|
||||
if (member && (user?.admin || !member.deleted)) {
|
||||
|
||||
const message = await MessageModel.count({ "author.id": id });
|
||||
const thread = await ThreadModel.count({ "author.id": id });
|
||||
const message = await MessageModel.count({ authorID: id });
|
||||
const thread = await ThreadModel.count({ authorID: id });
|
||||
member.about = member.about.replaceAll("&", "&")
|
||||
.replaceAll("<", "<").replaceAll(">", ">")
|
||||
.replaceAll("\"", """).replaceAll("'", "'")
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<div class="message" id="message-<%= message.id %>">
|
||||
<div class="left">
|
||||
<img src="<%= message.author.avatar || '/images/guest.png' %>"/>
|
||||
<div class="username"><a href="/users/<%=message.author.id %>"><%=message.author.name %></a></div>
|
||||
<div class="username"><a href="/users/<%=message.authorID %>"><%=message.author.name %></a></div>
|
||||
<div class="date">
|
||||
<%= new Date(message.time).toLocaleDateString() %>
|
||||
</div>
|
||||
|
@ -52,7 +52,7 @@
|
|||
|
||||
<div class="content"><%- message.content %></div>
|
||||
<% if(user){ %>
|
||||
<% if(user.id === message.author.id || user.admin){ %>
|
||||
<% if(user.id === message.authorID || user.admin){ %>
|
||||
|
||||
<div class="dots" id="dots-<%=message.id %>" onclick="dots('<%=message.id %>')">
|
||||
<% if (message.deleted){ %>
|
||||
|
|
|
@ -19,8 +19,11 @@
|
|||
<%= thread.title %>
|
||||
</div>
|
||||
<div class="box-username">
|
||||
<a class="btn-danger"><i class="fa-solid fa-trash-can"></i></a>
|
||||
<% if (user && !thread.deleted){ %>
|
||||
<a class="btn-danger" onclick="fetch('/api/threads/<%= thread.id %>/',{method:'DELETE'})"><i class="fa-solid fa-trash-can"></i></a>
|
||||
<% } %>
|
||||
<%= thread.author.name %> <div class="avatar"><img src="<%=thread.author.avatar %>"> </div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue