Return number of remarks with thread and clean up templates (explicit dereference)

This commit is contained in:
swagg boi 2022-09-20 14:33:56 -04:00
parent 3d5a75ffd8
commit e69ca992c0

View file

@ -2,17 +2,18 @@
% title 'Threads List';
<h2><%= title %></h2>
<div class="threads">
<% for my $thread (@$threads) { =%>
<% for my $thread (@{$threads}) { =%>
<article class="thread">
<span class="id">
<%= link_to "Thread #$thread->{'id'}",
thread_page => {thread_id => $thread->{'id'}} %>
</span>
<h3 class="title"><%= %$thread{'title'} %></h3>
<h4 class="date"><%= %$thread{'date'} %></h4>
<h5 class="author"><%= %$thread{'author'} %></h5>
<p class="body"><%= %$thread{'body'} %></p>
<h3 class="title"><%= $thread->{'title'} %></h3>
<h4 class="date"><%= $thread->{'date'} %></h4>
<h5 class="author"><%= $thread->{'author'} %></h5>
<p class="body"><%= $thread->{'body'} %></p>
<%= link_to Remark => thread_id => {thread_id => $thread->{'id'}} %>
<footer><%= $thread->{'remark_count'} %> remarks</footer>
</article>
<% } =%>
</div>