2022-03-13 16:16:46 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
2022-08-26 20:22:46 +03:00
|
|
|
<%- include("extra/meta", {title: "Thread list!" }) %>
|
2022-03-13 16:16:46 +03:00
|
|
|
|
2022-08-26 16:27:29 +03:00
|
|
|
<body>
|
2022-09-01 15:19:12 +03:00
|
|
|
<link href='https://unpkg.com/boxicons@2.1.2/css/boxicons.min.css' rel='stylesheet'>
|
2022-09-01 14:02:47 +03:00
|
|
|
|
2022-08-26 16:27:29 +03:00
|
|
|
<link rel="stylesheet" href="/css/threads.css" />
|
2022-09-01 15:19:12 +03:00
|
|
|
<link rel="stylesheet" href="/css/pages.css" />
|
2022-03-26 23:28:10 +03:00
|
|
|
|
2022-09-01 14:02:47 +03:00
|
|
|
<%- include("extra/navbar") %>
|
2022-03-26 23:28:10 +03:00
|
|
|
|
2022-09-01 14:02:47 +03:00
|
|
|
<div class="threads">
|
2022-03-26 23:28:10 +03:00
|
|
|
|
2022-09-01 14:02:47 +03:00
|
|
|
<% threads.forEach(thread=>{ %>
|
2022-08-26 16:27:29 +03:00
|
|
|
<a href="<%= thread.getLink() %>" class="">
|
2022-09-01 14:02:47 +03:00
|
|
|
<div class="threads-box">
|
|
|
|
<div class="thread-box-title">
|
|
|
|
<% if (thread.deleted) { %> <span>[DELETED]</span><% } %>
|
|
|
|
<%= thread.title %>
|
|
|
|
</div>
|
|
|
|
<div class="box-username">
|
|
|
|
<% if (user && !thread.deleted){ %>
|
2022-09-01 15:19:12 +03:00
|
|
|
<a class="btn-danger" onclick="fetch('/api/threads/<%= thread.id %>/',{method:'DELETE'})"><i class="bx bx-trash bx-sm"></i></a>
|
2022-09-01 14:02:47 +03:00
|
|
|
<% } %>
|
|
|
|
<%= thread.author.name %> <div class="avatar"><img src="<%=thread.author.avatar %>"> </div>
|
|
|
|
|
2022-08-26 16:27:29 +03:00
|
|
|
</div>
|
2022-03-26 23:28:10 +03:00
|
|
|
|
2022-09-01 14:02:47 +03:00
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
<br>
|
|
|
|
<% }); %>
|
|
|
|
|
|
|
|
</div>
|
2022-09-01 16:23:46 +03:00
|
|
|
<% if(typeof page === "number"){ %>
|
|
|
|
|
2022-09-01 15:19:12 +03:00
|
|
|
<div class="pagination">
|
|
|
|
<div class="back">
|
|
|
|
<% if (page > 0){ %>
|
|
|
|
<a href="/threads?page=<%= page-1 %>" class='bx bxs-chevron-left'></a>
|
|
|
|
<% } %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="numbers">
|
|
|
|
<% for(let i=0; i < pages; i++){ %>
|
|
|
|
<a class="number <%= i==page?'active':'' %>" href="/threads?page=<%= i %>"><%= i+1 %></a>
|
|
|
|
<% } %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="after">
|
|
|
|
<% if (pages-1 > page) { %>
|
|
|
|
<a href="/threads?page=<%= page +1 %>" class='bx bxs-chevron-right'></a>
|
|
|
|
<% } %>
|
|
|
|
</div>
|
2022-09-01 14:02:47 +03:00
|
|
|
|
2022-09-01 15:19:12 +03:00
|
|
|
</div>
|
2022-09-01 16:23:46 +03:00
|
|
|
<% } %>
|
|
|
|
|
2022-09-01 14:02:47 +03:00
|
|
|
</body>
|