% layout 'default'; % title 'Threads List'; % content_for open_graph => begin % end % content_for twitter_card => begin % end

<%= title %>

<% if (scalar @{$threads}) { =%>
<%= form_for search_page => (class => 'form-body'), begin %>
<% if (my $error = validation->error('q')) { =%>

Must be between <%= $error->[2] %> and <%= $error->[3] %> characters.

<% } =%> <%= label_for search => 'Search' %> <%= text_field q => ( id => 'search', maxlength => 2047, minlength => 1, required => undef ) %>
<% end %> <% for my $thread (@{$threads}) { =%>

<%= $thread->{'title'} %> <%= link_to "#$thread->{'id'}", single_thread => {thread_id => $thread->{'id'}}, (class => 'post__id') %>

<%== markdown truncate_text $thread->{'body'} =%>
<% } =%> <% if ($last_page && $last_page != 1) { =%> <% } =%>
<% } =%>