akf-forum/views/thread.ejs

58 lines
No EOL
1.6 KiB
Text

<!DOCTYPE html>
<html lang="en">
<%- include("extra/header", { title: thread.title }) %>
<body>
<%- include("extra/navbar", {user}) %>
<h1 style="font-size: 35px;">
<%= thread.title %>
</h1>
<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>
<% 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>
<% }; %>
<hr>
<div id="messages" value="<%= thread.id %>">
<% if (!user){ %>
<h1>Guests cant view messages!</h1>
<% }%>
</div>
<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>
<%} else {%>
<button disabled>Login for send</button>
<% }%>
</form>
<% if (user){ %>
<script type="module" src="/js/thread.js"></script>
<% }%>
<%- include("extra/footer") %>
</body>
</html>