PostText/templates/thread/by_page.html.ep
2023-05-21 01:03:01 -04:00

41 lines
1.4 KiB
Plaintext

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