Some clean-up

This commit is contained in:
swag 2022-09-20 21:16:42 -04:00
parent e69ca992c0
commit bb47eb82a4
7 changed files with 29 additions and 25 deletions

View File

@ -70,7 +70,7 @@ $t->post_ok('/post/1')->status_is(200)
->text_like(h2 => qr/New Remark/);
$t->post_ok('/post/1', form => \%valid_remark)->status_is(200)
->text_like(h2 => qr/Thread - #1/);
->text_like(h2 => qr/Thread #1/);
$t->post_ok('/post/1', form => \%invalid_remark)->status_is(400)
->text_like(h2 => qr/New Remark/);

View File

@ -9,6 +9,6 @@ use Test::Mojo;
my $script = curfile->dirname->sibling('PostText.pl');
my $t = Test::Mojo->new($script);
$t->get_ok('/remark/1')->status_is(200)->text_like(h2 => qr/Remark - #1/);
$t->get_ok('/remark/1')->status_is(200)->text_like(h2 => qr/Remark #1/);
done_testing();

View File

@ -9,6 +9,6 @@ use Test::Mojo;
my $script = curfile->dirname->sibling('PostText.pl');
my $t = Test::Mojo->new($script);
$t->get_ok('/thread/1')->status_is(200)->text_like(h2 => qr/Thread - #1/);
$t->get_ok('/thread/1')->status_is(200)->text_like(h2 => qr/Thread #1/);
done_testing();

View File

@ -5,15 +5,19 @@
<% for my $thread (@{$threads}) { =%>
<article class="thread">
<span class="id">
<%= link_to "Thread #$thread->{'id'}",
<%= link_to "#$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>
<span class="remarks">
<%= link_to Remark => thread_id => {thread_id => $thread->{'id'}} %>
<footer><%= $thread->{'remark_count'} %> remarks</footer>
<%= link_to thread_page => {thread_id => $thread->{'id'}}, begin %>
(<%= $thread->{'remark_count'} %> remarks)
<% end %>
</span>
</article>
<% } =%>
</div>

View File

@ -1,12 +1,12 @@
% layout 'main';
% title "Remark - #$remark->{'id'}";
% title "Remark #$remark->{'id'}";
<h2><%= title %></h2>
<div class="remarks">
<article class="remark">
<span class="id">#<%= %$remark{'id'} %></span>
<h4 class="date"><%= %$remark{'date'} %></h4>
<h5 class="author"><%= %$remark{'author'} %></h5>
<p class="body"><%= %$remark{'body'} %></p>
<span class="id">#<%= $remark->{'id'} %></span>
<h4 class="date"><%= $remark->{'date'} %></h4>
<h5 class="author"><%= $remark->{'author'} %></h5>
<p class="body"><%= $remark->{'body'} %></p>
</article>
</div>
<nav>

View File

@ -34,10 +34,10 @@
<%= link_to "#$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>
</article>
</div>
<% if (my $last_remark_id = $last_remark->{'id'}) { =%>

View File

@ -1,29 +1,29 @@
% layout 'main';
% title "Thread - #$thread->{'id'}";
% title "Thread #$thread->{'id'}";
<h2><%= title %></h2>
<div class="threads">
<article class="thread">
<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>
</article>
</div>
<nav>
<%= link_to Remark => thread_id => {thread_id => $thread->{'id'}} %>
</nav>
<% if (my $first_remark = @$remarks[0]) { =%>
<% if (my $first_remark = $remarks->[0]) { =%>
<div class="remarks">
<h3>Remarks</h3>
<% for my $remark (@$remarks) { =%>
<% for my $remark (@{$remarks}) { =%>
<article class="remark">
<span class="id">
<%= link_to "#$remark->{'id'}",
remark_id => {remark_id => $remark->{'id'}} %>
</span>
<h4 class="date"><%= %$remark{'date'} %></h4>
<h5 class="author"><%= %$remark{'author'} %></h5>
<p class="body"><%= %$remark{'body'} %></p>
<h4 class="date"><%= $remark->{'date'} %></h4>
<h5 class="author"><%= $remark->{'author'} %></h5>
<p class="body"><%= $remark->{'body'} %></p>
</article>
<% } =%>
</div>