26 lines
1.2 KiB
Plaintext
26 lines
1.2 KiB
Plaintext
<h1><%= topic.name %></h1>
|
|
<h2><%= topic.description %></h2>
|
|
<% if #threads_list == 0 then %>
|
|
<p>There are no threads in this topic.</p>
|
|
<% end %>
|
|
|
|
<% if thread_create_error == ThreadCreateError.OK then %>
|
|
<a href=<%= url_for("thread_create", nil, {topic_id = topic.id}) %>>New thread</a>
|
|
<% elseif thread_create_error == ThreadCreateError.GUEST then %>
|
|
<p>Your account is still pending confirmation by an administrator. You are not able to create a new thread or post at this time.</p>
|
|
<% elseif thread_create_error == ThreadCreateError.LOGGED_OUT then %>
|
|
<p>Only logged in users can create threads. <a href="<%= url_for("user_signup") %>">Sign up</a> or <a href="<%= url_for("user_login")%>">log in</a> to create a thread.</p>
|
|
<% else %>
|
|
<p>This topic is locked.</p>
|
|
<% end %>
|
|
|
|
<% if user:is_admin() then %>
|
|
<br>
|
|
<a href="<%= url_for("topic_edit", {slug = topic.slug}) %>">Edit topic</a>
|
|
<form method="post" action="<%= url_for("topic_edit", {slug = topic.slug}) %>">
|
|
<input type="hidden" name="is_locked" value="<%= not ntob(topic.is_locked) %>">
|
|
<p><%= "This topic is " .. (ntob(topic.is_locked) and "" or "un") .. "locked." %></p>
|
|
<input type="submit" id="lock" value="<%= ntob(topic.is_locked) and "Unlock" or "Lock" %>">
|
|
</form>
|
|
<% end %>
|