2022-09-09 20:47:28 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<%- include("extra/meta", {title: "Thread list!" }) %>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<link href='https://unpkg.com/boxicons@2.1.2/css/boxicons.min.css' rel='stylesheet'>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="/css/threads.css" />
|
|
|
|
<link rel="stylesheet" href="/css/pages.css" />
|
|
|
|
|
|
|
|
<%- include("extra/navbar") %>
|
|
|
|
<div class="threads">
|
|
|
|
<% categories.forEach(category=>{ %>
|
2022-09-17 00:51:52 +03:00
|
|
|
<a href="<%= category.getLink() %>">
|
2022-09-09 20:47:28 +03:00
|
|
|
<div class="threads-box">
|
|
|
|
<div class="thread-box-title">
|
|
|
|
<%= category.name %>
|
|
|
|
</div>
|
2022-09-17 00:51:52 +03:00
|
|
|
|
|
|
|
<div class="box-username"> <%if(user?.admin) {%>
|
2022-09-09 20:47:28 +03:00
|
|
|
<a class="btn-danger" onclick="fetch('/api/categories/<%= category.id %>/',{method:'DELETE'})"><i class="bx bx-trash bx-sm"></i></a>
|
2022-09-17 00:51:52 +03:00
|
|
|
<% }; %><%= category.desp %>
|
2022-09-09 20:47:28 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
<br>
|
|
|
|
<% }); %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<% if(typeof page === "number"){ %>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<% } %>
|
2022-09-17 00:51:52 +03:00
|
|
|
<%- include("extra/footer") %>
|
|
|
|
|
|
|
|
</body>
|
2022-09-09 20:47:28 +03:00
|
|
|
|
2022-09-17 00:51:52 +03:00
|
|
|
</html>
|