akf-forum/views/thread.ejs

69 lines
2.2 KiB
Text
Raw Normal View History

2022-03-13 16:16:46 +03:00
<!DOCTYPE html>
<html lang="en">
2022-08-26 16:27:29 +03:00
<%- include("extra/old_header", { title: thread.title }) %>
2022-03-26 23:28:10 +03:00
2022-08-11 17:55:48 +03:00
<body>
2022-08-26 16:27:29 +03:00
<%- include("extra/old_navbar", {user}) %>
2022-03-13 16:16:46 +03:00
2022-08-11 17:55:48 +03:00
<h1 style="font-size: 35px;">
<%= thread.title %>
</h1>
2022-03-13 16:16:46 +03:00
2022-08-11 17:55:48 +03:00
<h2 style="display:inline;">By <a href=<%="/users/" + thread.author.id %>> <%= thread.author.name %></a>
<img class="circle" src=<%=thread.author.avatar %> alt=<%= thread.author.name %>>
</h2>
2022-03-13 16:16:46 +03:00
2022-08-11 17:55:48 +03:00
<% if (user && !thread.deleted){ %>
<button id="delete_thread" value="<%= thread.id %>" style="display:inline;" type="submit">DELETE</button>
<button id="edit_thread" style="display:inline;" type="submit">EDIT</button>
<% } else if (thread.deleted) { %>
<h3 style="display:inline;">This thread has been deleted</h3>
<% }; %>
2022-03-13 16:16:46 +03:00
2022-08-11 17:55:48 +03:00
<hr>
2022-04-06 21:14:46 +03:00
2022-03-13 16:16:46 +03:00
2022-08-11 17:55:48 +03:00
<div id="messages" value="<%= thread.id %>">
<% if (!user){ %>
<h1>Guests cant view messages!</h1>
<% }%>
</div>
2022-08-11 17:55:48 +03:00
<hr>
2022-03-21 23:53:22 +03:00
2022-03-13 16:16:46 +03:00
2022-08-11 17:55:48 +03:00
<form id="send">
<textarea rows="4" cols="133" name="content"></textarea>
<input name="threadID" type="hidden" value="<%= thread.id %>"></input>
2022-04-03 21:01:55 +03:00
2022-08-11 17:55:48 +03:00
<br>
<% if (user){ %>
<button type="submit">Send!</button>
<%} else {%>
<button disabled>Login for send</button>
<% }%>
2022-04-03 21:01:55 +03:00
2022-08-11 17:55:48 +03:00
</form>
2022-08-11 17:55:48 +03:00
<% if (user){ %>
<script type="module" src="/js/thread.js"></script>
<% }%>
<script>
document.getElementById("message-<%= scroll %>").scrollIntoView();
</script>
2022-08-24 23:10:29 +03:00
<!-- <div style="float: right;">
<h3 id="page_count" style="display:inline;">1</h3>
<button id="left_page" style=" display:inline;float: right;" type="submit">PREV</button>
<button id="right_page" style="display:inline;float: right;" type="submit">NEXT</button>
</div>-->
2022-08-26 16:27:29 +03:00
<%- include("extra/old_footer") %>
2022-08-11 17:55:48 +03:00
</body>
2022-03-13 16:16:46 +03:00
2022-08-11 17:55:48 +03:00
</html>