36 lines
1.8 KiB
Plaintext
36 lines
1.8 KiB
Plaintext
<div class="darkbg">
|
|
<h1 class="thread-title">Inbox</h1>
|
|
</div>
|
|
<div class="inbox-container">
|
|
<% if #new_posts == 0 then %>
|
|
You have no unread posts.
|
|
<% else %>
|
|
You have <%= total_unreads_count %> unread post<%= total_unreads_count > 1 and "s" or "" %>:
|
|
<% for _, thread in ipairs(new_posts) do %>
|
|
<div class="accordion">
|
|
<div class="accordion-header">
|
|
<button type="button" class="accordion-toggle">▼</button>
|
|
<% local latest_post_id = thread.posts[#thread.posts].id %>
|
|
<%
|
|
local unread_posts_text = " (" .. thread.unread_count .. " unread post" .. (thread.unread_count > 1 and "s" or "")-- .. ")"
|
|
%>
|
|
<a class="accordion-title" href="<%= url_for("thread", {slug = thread.thread_slug}, {after = latest_post_id}) .. "#post-" .. latest_post_id %>" title="Jump to latest post"><%= thread.thread_title .. unread_posts_text %>, latest at <% render("views.common.timestamp", {timestamp = thread.newest_post_time}) -%>)</a>
|
|
<form action="<%= url_for("thread_subscribe", {slug = thread.thread_slug}) %>" method="post">
|
|
<input type="hidden" name="subscribe" value="read">
|
|
<input type="submit" value="Mark Thread as Read">
|
|
</form>
|
|
<form action="<%= url_for("thread_subscribe", {slug = thread.thread_slug}) %>" method="post">
|
|
<input type="hidden" name="subscribe" value="unsubscribe">
|
|
<input class="warn" type="submit" value="Unsubscribe">
|
|
</form>
|
|
</div>
|
|
<div class="accordion-content">
|
|
<% for _, post in ipairs(thread.posts) do %>
|
|
<% render("views.threads.post", {post = post, edit = false, is_latest = false, no_reply = true, thread = get_thread_by_id(thread.thread_id)}) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|