27 lines
932 B
Plaintext
27 lines
932 B
Plaintext
<%
|
|
local is_locked = ntob(thread.is_locked)
|
|
local can_post = (not is_locked and not me:is_guest()) or me:is_mod()
|
|
%>
|
|
<main>
|
|
<nav class="darkbg">
|
|
<h1 class="thread-title"><%= thread.title %></h1>
|
|
<span>Posted in <a href="<%= url_for("topic", {slug = topic.slug}) %>"><%= topic.name %></a></span>
|
|
</nav>
|
|
<% for i, post in ipairs(posts) do %>
|
|
<% render("views.threads.post", {post = post, render_sig = true, is_latest = i == #posts}) %>
|
|
<% end %>
|
|
</main>
|
|
|
|
<nav id="bottomnav">
|
|
<% render("views.common.pagination", {page_count = pages, current_page = page}) %>
|
|
</nav>
|
|
|
|
<% if is_locked then -%>
|
|
<% render("views.common.infobox", {kind = constants.InfoboxKind.LOCK, msg = "This thread is locked."}) %>
|
|
<% end -%>
|
|
<% if can_post then %>
|
|
<h1>Respond to "<%= thread.title %>"</h1>
|
|
<% render("views.common.babycode-editor", {ta_name="post_content"}) %>
|
|
<script src="/static/js/thread.js"></script>
|
|
<% end %>
|