PostText/templates/thread/by_id.html.ep

72 lines
2.4 KiB
Plaintext
Raw Normal View History

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