2022-03-13 16:16:46 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
|
2022-08-26 22:09:02 +03:00
|
|
|
<%- include("extra/meta", {title: "Thread list!" }) %>
|
2022-03-26 23:28:10 +03:00
|
|
|
|
2022-08-11 17:55:48 +03:00
|
|
|
|
2022-08-26 22:09:02 +03:00
|
|
|
<body style="text-align: center;">
|
|
|
|
<%- include("extra/navbar") %>
|
2022-08-11 02:43:15 +03:00
|
|
|
|
2022-08-26 22:09:02 +03:00
|
|
|
<link rel="stylesheet" href="/css/thread.css" />
|
2022-08-27 14:08:28 +03:00
|
|
|
<% if (user){ %>
|
|
|
|
<script type="module" src="/js/thread.js"></script>
|
|
|
|
<% }%>
|
2022-03-13 16:16:46 +03:00
|
|
|
|
|
|
|
|
2022-08-27 14:08:28 +03:00
|
|
|
<h1 style="font-size: 35px;color: #4d18e6;" ><%= thread.title %></h1>
|
2022-08-28 15:23:19 +03:00
|
|
|
<h3 >View count: <%= thread.views %></h1>
|
2022-03-13 16:16:46 +03:00
|
|
|
|
2022-08-27 14:08:28 +03:00
|
|
|
<h2 style="display:inline;">By <a href="<%='/users/' + thread.author.id %>"> <%= thread.author.name %></a>
|
2022-08-27 10:31:16 +03:00
|
|
|
<img class="circle" src="<%=thread.author.avatar %>">
|
2022-08-26 22:09:02 +03:00
|
|
|
</h2>
|
2022-08-11 17:55:48 +03:00
|
|
|
|
2022-08-26 22:09:02 +03:00
|
|
|
<% if (user && !thread.deleted){ %>
|
2022-03-13 16:16:46 +03:00
|
|
|
|
2022-08-27 14:08:28 +03:00
|
|
|
<a onclick="delete_thread('<%= thread.id %>' )" value=style="display:inline;" >DELETE</a>
|
|
|
|
<a onclick="edit_thread('<%= thread.id %>')" style="display:inline;" >EDIT</a>
|
|
|
|
<% } else if (thread.deleted) { %>
|
|
|
|
<h3 style="display:inline;">This thread has been deleted</h3>
|
|
|
|
<a onclick="undelete_thread('<%= thread.id %>')" style="display:inline;" >UNDELETE</a>
|
2022-04-06 21:14:46 +03:00
|
|
|
|
2022-08-27 14:08:28 +03:00
|
|
|
<% }; %>
|
2022-03-13 16:16:46 +03:00
|
|
|
|
2022-08-11 02:43:15 +03:00
|
|
|
|
2022-08-26 22:09:02 +03:00
|
|
|
<hr>
|
2022-03-21 23:53:22 +03:00
|
|
|
|
2022-03-13 16:16:46 +03:00
|
|
|
|
2022-08-26 22:09:02 +03:00
|
|
|
<div id="messages" value="<%= thread.id %>">
|
2022-08-28 18:19:03 +03:00
|
|
|
|
|
|
|
<% messages.filter(Boolean).forEach(message=>{ %>
|
2022-04-03 21:01:55 +03:00
|
|
|
|
2022-08-28 18:19:03 +03:00
|
|
|
<div class="message" id="message-<%= message.id %>">
|
2022-08-26 22:09:02 +03:00
|
|
|
|
2022-08-28 18:19:03 +03:00
|
|
|
<h3 style="float:right;"><%= new Date(message.time).toLocaleString() %> </h3>
|
2022-08-26 22:09:02 +03:00
|
|
|
|
|
|
|
<h2>
|
2022-08-28 18:19:03 +03:00
|
|
|
<img class="circle" src="<%= message.author.avatar %>">
|
|
|
|
<a href="/users/<%=message.author.id %>"><%=message.author.name %></a>:
|
2022-08-26 22:09:02 +03:00
|
|
|
</h2>
|
|
|
|
|
2022-08-28 18:19:03 +03:00
|
|
|
<p><%= message.content%></p><br>
|
|
|
|
<div id="message-delete-<%=message.id %>">
|
|
|
|
|
|
|
|
<% if (!message.deleted){ %>
|
|
|
|
|
|
|
|
<a onclick="delete_message('<%=message.id %>');">DELETE</a>
|
|
|
|
<a onclick="edit_message('<%=message.id %>');">EDIT</a>
|
|
|
|
<% }else{ %>
|
|
|
|
<h3 style="display:inline;">This message has been deleted</h3>
|
|
|
|
<a onclick="undelete_message('<%=message.id %>');">UNDELETE</a>
|
|
|
|
<% } %>
|
2022-08-27 14:08:28 +03:00
|
|
|
|
2022-08-26 22:09:02 +03:00
|
|
|
</div>
|
|
|
|
<div style="float: right;">
|
2022-08-28 18:19:03 +03:00
|
|
|
<h3 id="count<%=message.id %>" style="display:inline;"><%=message.reactCount %></h3>
|
|
|
|
<a onclick="react('<%=message.id %>', 'like');">+🔼</a>
|
|
|
|
<a onclick="react('<%=message.id %>', 'dislike');">-🔽</a>
|
2022-08-26 22:09:02 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-08-28 18:19:03 +03:00
|
|
|
<% }); %>
|
2022-04-03 21:01:55 +03:00
|
|
|
|
2022-08-26 22:09:02 +03:00
|
|
|
</div>
|
2022-08-24 23:00:33 +03:00
|
|
|
|
2022-08-26 22:09:02 +03:00
|
|
|
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
<form id="send">
|
|
|
|
<textarea rows="4" cols="133" name="content"></textarea>
|
|
|
|
<input name="threadID" type="hidden" value="<%= thread.id %>"></input>
|
|
|
|
|
|
|
|
<br>
|
|
|
|
<% if (user){ %>
|
|
|
|
<button type="submit">Send!</button>
|
2022-08-27 14:08:28 +03:00
|
|
|
<%} else {%>
|
|
|
|
<button disabled>Login for send</button>
|
|
|
|
<% }%>
|
2022-08-26 22:09:02 +03:00
|
|
|
|
|
|
|
</form>
|
|
|
|
|
2022-08-27 14:08:28 +03:00
|
|
|
|
2022-08-26 22:09:02 +03:00
|
|
|
<script>
|
|
|
|
document.getElementById("message-<%= scroll %>").scrollIntoView();
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<!-- BURAYA Bİ İLERİ BİR GERİ SAYFA BUTONU GELMEZ Mİ BE-->
|
|
|
|
</body>
|
2022-03-13 16:16:46 +03:00
|
|
|
|
2022-08-11 17:55:48 +03:00
|
|
|
</html>
|