Update thread.ejs

This commit is contained in:
tokmak0 2022-08-28 20:36:39 +03:00 committed by GitHub
parent 68e4a92b8a
commit c43011d83d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,87 +4,69 @@
<%- include("extra/meta", {title: "Thread list!" }) %> <%- include("extra/meta", {title: "Thread list!" }) %>
<body style="text-align: center;"> <body>
<%- include("extra/navbar") %> <%- include("extra/navbar") %>
<link href='https://unpkg.com/boxicons@2.1.2/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="/css/thread.css" /> <link rel="stylesheet" href="/css/thread.css" />
<% if (user){ %> <% if (user){ %>
<script type="module" src="/js/thread.js"></script> <script type="module" src="/js/thread.js"></script>
<% }%> <% }%>
<div style="text-align:center;padding:8px">
<h1 style="font-size: 35px;color: #4d18e6;" ><%= thread.title %></h1> <div class="title">İlk Forum</div>
<h3 >View count: <%= thread.views %></h1> <div class="date">
20/04/2000
<h2 style="display:inline;">By <a href="<%='/users/' + thread.author.id %>"> <%= thread.author.name %></a>
<img class="circle" src="<%=thread.author.avatar %>">
</h2>
<% if (user && !thread.deleted){ %>
<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>
<% }; %>
<hr>
<div id="messages" value="<%= thread.id %>">
<% messages.filter(Boolean).forEach(message=>{ %>
<div class="message" id="message-<%= message.id %>">
<h3 style="float:right;"><%= new Date(message.time).toLocaleString() %> </h3>
<h2>
<img class="circle" src="<%= message.author.avatar %>">
<a href="/users/<%=message.author.id %>"><%=message.author.name %></a>:
</h2>
<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>
<% } %>
</div>
<div style="float: right;">
<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>
</div> </div>
</div> </div>
<% }); %> <div class="thread">
<div class="left">
<img src="https://renk.gen.tr/images/acik-mavi-renk.jpg"/>
<div class="username">Tokmak</div>
</div>
<div class="content">
Merhaba ! Bu benim ilk yazım Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
Merhaba ! Bu benim ilk yazım
</div>
<div class="likes">
<div>
<i class='bx bx-like'></i> 5
</div>
<div>
<i class='bx bx-dislike'></i> 30
</div>
</div>
</div>
<div class="pagination">
<div class="back">
<i class='bx bxs-chevron-left'></i>
</div>
<div class="numbers">
<a class="number" href="/deneme">1</a>
<a class="number" href="/deneme">2</a>
<a class="number" href="/deneme">3</a>
<a class="number" href="/deneme">4</a>
<a class="number" href="/deneme">5</a>
<a class="number" href="/deneme">6</a>
</div>
<div class="after">
<i class='bx bxs-chevron-right'></i>
</div>
</div> </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>
<script> <script>