PostText/templates/thread/by_page.html.ep
2023-05-14 00:48:24 -04:00

39 lines
1.3 KiB
Plaintext

% layout 'default';
% title 'Threads List';
<h2><%= title %></h2>
<main class="threads">
<% for my $thread (@{$threads}) { =%>
<article class="thread">
<h3 class="title">
<%= link_to single_thread => {thread_id => $thread->{'id'}}, begin %>
<%= $thread->{'title'} %>
<% end %>
<%= link_to "#$thread->{'id'}",
single_thread => {thread_id => $thread->{'id'}}, (class => 'id') %>
</h3>
<h4 class="date"><%= $thread->{'date'} %></h4>
<h5 class="author"><%= $thread->{'author'} %></h5>
<div class="body">
<%== markdown truncate_text $thread->{'body'} =%>
</div>
<nav>
<%= link_to Remark => post_remark => {thread_id => $thread->{'id'}} %>
<%= link_to url_for(single_thread => {thread_id => $thread->{'id'}})
->fragment('remarks'), begin %>
<%= $thread->{'remark_tally'} %> Remarks
<% end %>
<%= link_to bump_thread => {thread_id => $thread->{'id'}}, begin %>
Bump (<%= $thread->{'bump_tally'} %>)
<% end %>
<%= link_to Flag => flag_thread => {thread_id => $thread->{'id'}},
(class => 'flag') %>
</nav>
</article>
<% } =%>
<% if ($last_page && $last_page != 1) { =%>
<nav>
<%= pagination $this_page, $last_page, ($base_path . '/{page}') %>
</nav>
<% } =%>
</main>