2022-11-28 23:22:25 -05:00
|
|
|
% layout 'default';
|
2023-05-28 02:07:09 -04:00
|
|
|
% title my $thread_id = $thread->{'id'} ? "Thread #$thread_id" : '?';
|
2023-05-19 18:49:08 -04:00
|
|
|
<h2 class="page-title"><%= title %></h2>
|
2023-05-29 00:27:16 -04:00
|
|
|
<% if (keys %{$thread}) { =%>
|
2023-06-04 16:36:13 -04:00
|
|
|
<% content_for open_graph => begin %>
|
|
|
|
<meta property="og:type" content="article">
|
2023-06-04 17:47:36 -04:00
|
|
|
<meta property="og:title" content="<%= $thread->{'title'} %>">
|
2023-06-04 16:36:13 -04:00
|
|
|
<meta property="og:description"
|
|
|
|
content="<%= truncate_text $thread->{'body'} %>">
|
|
|
|
<% end %>
|
2023-06-07 15:43:45 -04:00
|
|
|
<% content_for twitter_card => begin %>
|
|
|
|
<meta name="twitter:title" content="<%= $thread->{'title'} %>">
|
|
|
|
<meta name="twitter:description"
|
|
|
|
content="<%= truncate_text $thread->{'body'} %>">
|
|
|
|
<% end %>
|
2023-05-19 18:49:08 -04:00
|
|
|
<main class="pager">
|
|
|
|
<article class="post">
|
|
|
|
<h3 class="post__title">
|
2023-05-14 22:43:13 -04:00
|
|
|
<%= $thread->{'title'} %>
|
2023-05-29 00:27:16 -04:00
|
|
|
<span class="post__id">#<%= $thread->{'id'} %></span>
|
2023-05-14 22:43:13 -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>
|
|
|
|
<div class="post__body">
|
2023-05-03 21:05:57 -04:00
|
|
|
<%== markdown $thread->{'body'} =%>
|
|
|
|
</div>
|
2023-05-19 18:49:08 -04:00
|
|
|
<nav class="post__nav">
|
2023-05-20 22:53:32 -04:00
|
|
|
<%= link_to post_remark => {thread_id => $thread->{'id'}},
|
|
|
|
(class => 'click'), begin %>
|
2023-05-14 22:04:11 -04:00
|
|
|
Remark (<%= $thread->{'remark_tally'} %>)
|
2023-05-12 22:43:23 -04:00
|
|
|
<% end %>
|
2023-05-20 22:53:32 -04:00
|
|
|
<%= link_to bump_thread => {thread_id => $thread->{'id'}},
|
|
|
|
(class => 'click'), begin %>
|
2023-05-14 22:04:11 -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') %>
|
2023-05-09 20:07:28 -04:00
|
|
|
</nav>
|
|
|
|
<% if (is_mod) { =%>
|
2023-05-19 18:49:08 -04:00
|
|
|
<nav class="post__nav">
|
2023-05-20 22:53:32 -04:00
|
|
|
<%= link_to Hide => hide_thread => {thread_id => $thread->{'id'}},
|
|
|
|
(class => 'click') %>
|
|
|
|
<%= link_to Unhide => unhide_thread => {thread_id => $thread->{'id'}},
|
|
|
|
(class => 'click') %>
|
|
|
|
<%= link_to Unflag => unflag_thread => {thread_id => $thread->{'id'}},
|
|
|
|
(class => 'click') %>
|
2023-05-09 20:07:28 -04:00
|
|
|
</nav>
|
|
|
|
<% } =%>
|
2022-08-24 00:35:35 -04:00
|
|
|
</article>
|
2023-05-09 20:07:28 -04:00
|
|
|
</main>
|
2023-05-28 02:07:09 -04:00
|
|
|
<% } =%>
|
2023-06-02 15:11:15 -04:00
|
|
|
<% if (keys %{$thread} && scalar @{$remarks}) { =%>
|
2023-05-19 18:49:08 -04:00
|
|
|
<section class="pager" id="remarks">
|
2023-05-27 12:51:57 -04:00
|
|
|
<h3 class="pager__title">Remarks</h3>
|
2022-09-20 21:16:42 -04:00
|
|
|
<% for my $remark (@{$remarks}) { =%>
|
2023-05-19 18:49:08 -04:00
|
|
|
<article class="post">
|
2023-05-21 11:46:29 -04:00
|
|
|
<h4 class="post__title">
|
2023-05-24 21:57:54 -04:00
|
|
|
<span>
|
|
|
|
<%= $remark->{'date'} %>
|
|
|
|
</span>
|
2023-05-19 18:49:08 -04:00
|
|
|
<%= link_to "#$remark->{'id'}", single_remark =>
|
|
|
|
{remark_id => $remark->{'id'}}, (class => 'post__id') %>
|
2023-05-09 20:07:28 -04:00
|
|
|
</h4>
|
2023-05-19 18:49:08 -04:00
|
|
|
<h5 class="post__author"><%= $remark->{'author'} %></h5>
|
|
|
|
<div class="post__body">
|
2023-05-03 21:05:57 -04:00
|
|
|
<%== markdown $remark->{'body'} =%>
|
|
|
|
</div>
|
2023-05-19 18:49:08 -04:00
|
|
|
<nav class="post__nav">
|
2023-06-25 00:01:13 -04:00
|
|
|
<%= link_to Remark => post_remark =>
|
|
|
|
{thread_id => $thread->{'id'}, remark_id => $remark->{'id'}},
|
2023-05-20 22:53:32 -04:00
|
|
|
(class => 'click') %>
|
|
|
|
<%= link_to Flag => flag_remark => {remark_id => $remark->{'id'}},
|
|
|
|
(class => 'click') %>
|
2022-10-13 23:57:58 -04:00
|
|
|
</nav>
|
2022-08-24 00:35:35 -04:00
|
|
|
</article>
|
|
|
|
<% } =%>
|
2023-05-14 22:43:13 -04:00
|
|
|
<% if ($last_page && $last_page != 1) { =%>
|
2023-05-19 18:49:08 -04:00
|
|
|
<nav class="pager__nav">
|
2023-06-26 22:10:20 -04:00
|
|
|
<%= pagination $this_page, $last_page, ($base_path . '/{page}#remarks') %>
|
2023-05-13 17:50:19 -04:00
|
|
|
</nav>
|
2023-05-14 22:43:13 -04:00
|
|
|
<% } =%>
|
2023-05-09 20:07:28 -04:00
|
|
|
</section>
|
2022-08-24 00:35:35 -04:00
|
|
|
<% } =%>
|