32 lines
1002 B
Plaintext
32 lines
1002 B
Plaintext
<nav id="topnav">
|
|
<span>
|
|
<% if user:is_logged_in() then -%>
|
|
Welcome, <a href="<%= url_for("user", {username = user.username}) %>"><%= user.username %></a>
|
|
<% else -%>
|
|
Welcome, guest. Please <a href="<%= url_for("user_login") %>">log in</a>
|
|
<% end -%>
|
|
</span>
|
|
</nav>
|
|
|
|
<main>
|
|
<nav id="threadnav">
|
|
<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, is_latest = i == #posts}) %>
|
|
<% end %>
|
|
</main>
|
|
|
|
<nav id="bottomnav">
|
|
<% render("views.common.pagination", {page_count = pages, current_page = page}) %>
|
|
</nav>
|
|
|
|
<% if not user:is_guest() then %>
|
|
<h1>Respond to "<%= thread.title %>"</h1>
|
|
<form method="post">
|
|
<textarea id="post_content" name="post_content" placeholder="Response body" required></textarea><br>
|
|
<input type="submit" value="Reply">
|
|
</form>
|
|
<% end %>
|