PostText/templates/thread/by_page.html.ep

61 lines
2 KiB
Plaintext
Raw Normal View History

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