2022-11-28 23:22:25 -05:00
|
|
|
% layout 'default';
|
2022-10-01 18:00:23 -04:00
|
|
|
% title 'Threads List';
|
2023-06-04 14:34:10 -04:00
|
|
|
% content_for open_graph => begin
|
|
|
|
<meta property="og:type" content="website">
|
|
|
|
<meta property="og:title" content="<%= title %>">
|
|
|
|
<meta property="og:description" content="In UTF-8 we trust. 🫡">
|
|
|
|
% end
|
2023-06-07 15:43:45 -04:00
|
|
|
% content_for twitter_card => begin
|
|
|
|
<meta name="twitter:title" content="<%= title %>">
|
|
|
|
<meta name="twitter:description" content="In UTF-8 we trust. 🫡">
|
|
|
|
% end
|
2023-05-19 18:49:08 -04:00
|
|
|
<h2 class="page-title"><%= title %></h2>
|
2023-05-29 00:35:33 -04:00
|
|
|
<% if (scalar @{$threads}) { =%>
|
2023-05-19 18:49:08 -04:00
|
|
|
<main class="pager">
|
2022-10-01 18:00:23 -04:00
|
|
|
<% for my $thread (@{$threads}) { =%>
|
2023-05-19 18:49:08 -04:00
|
|
|
<article class="post">
|
|
|
|
<h3 class="post__title">
|
2023-05-24 21:57:54 -04:00
|
|
|
<span>
|
2023-04-24 23:00:09 -04:00
|
|
|
<%= $thread->{'title'} %>
|
2023-05-24 21:57:54 -04:00
|
|
|
</span>
|
2023-05-19 18:49:08 -04:00
|
|
|
<%= link_to "#$thread->{'id'}", single_thread =>
|
|
|
|
{thread_id => $thread->{'id'}}, (class => 'post__id') %>
|
2023-04-24 23:00:09 -04:00
|
|
|
</h3>
|
2023-05-19 18:49:08 -04:00
|
|
|
<h4 class="post__date"><%= $thread->{'date'} %></h4>
|
|
|
|
<h5 class="post__author"><%= $thread->{'author'} %></h5>
|
2023-12-10 01:05:48 -05:00
|
|
|
<% if (299 < length $thread->{'body'}) { =%>
|
2023-12-09 20:01:01 -05:00
|
|
|
<details class="post__body">
|
|
|
|
<summary>
|
2023-12-10 21:29:01 -05:00
|
|
|
<%= truncate_text $thread->{'body'} %>
|
2023-12-09 20:01:01 -05:00
|
|
|
</summary>
|
|
|
|
<%== markdown $thread->{'body'} =%>
|
|
|
|
</details>
|
|
|
|
<% } else { =%>
|
2023-05-19 18:49:08 -04:00
|
|
|
<div class="post__body">
|
2023-12-09 20:01:01 -05:00
|
|
|
<%== markdown $thread->{'body'} =%>
|
2023-05-03 21:05:57 -04:00
|
|
|
</div>
|
2023-12-09 20:01:01 -05:00
|
|
|
<% } =%>
|
2023-05-19 18:49:08 -04:00
|
|
|
<nav class="post__nav">
|
2023-05-20 22:53:32 -04:00
|
|
|
<%= link_to Remark => post_remark => {thread_id => $thread->{'id'}},
|
2023-06-04 17:51:05 -04:00
|
|
|
(class => 'click') %>
|
2022-10-08 22:39:54 -04:00
|
|
|
<%= link_to url_for(single_thread => {thread_id => $thread->{'id'}})
|
2023-05-20 22:53:32 -04:00
|
|
|
->fragment('remarks'), (class => 'click'), begin %>
|
2023-05-14 00:48:24 -04:00
|
|
|
<%= $thread->{'remark_tally'} %> Remarks
|
2023-05-21 01:03:01 -04:00
|
|
|
<% end %>
|
2023-05-20 22:53:32 -04:00
|
|
|
<%= link_to bump_thread => {thread_id => $thread->{'id'}},
|
2023-06-04 17:51:05 -04:00
|
|
|
(class => 'click'), begin %>
|
2023-05-14 00:48:24 -04:00
|
|
|
Bump (<%= $thread->{'bump_tally'} %>)
|
2023-05-12 22:43:23 -04:00
|
|
|
<% end %>
|
2023-05-20 22:53:32 -04:00
|
|
|
<%= link_to Flag => flag_thread => {thread_id => $thread->{'id'}},
|
|
|
|
(class => 'click') %>
|
2022-10-13 23:57:58 -04:00
|
|
|
</nav>
|
2022-10-01 18:00:23 -04:00
|
|
|
</article>
|
|
|
|
<% } =%>
|
2023-05-13 16:10:28 -04:00
|
|
|
<% if ($last_page && $last_page != 1) { =%>
|
2023-05-19 18:49:08 -04:00
|
|
|
<nav class="pager__nav">
|
2023-05-13 16:10:28 -04:00
|
|
|
<%= pagination $this_page, $last_page, ($base_path . '/{page}') %>
|
|
|
|
</nav>
|
2023-05-28 02:07:09 -04:00
|
|
|
<% } =%>
|
2023-05-13 16:10:28 -04:00
|
|
|
</main>
|
2023-05-28 02:07:09 -04:00
|
|
|
<% } =%>
|