Clean up remark->create plus new 404 behavior
This commit is contained in:
parent
957885a38e
commit
7cf9981973
|
@ -57,6 +57,9 @@ sub create($self) {
|
|||
last_remark => $last_remark
|
||||
);
|
||||
|
||||
$self->stash(status => 404, error => 'Thread not found 🤷')
|
||||
unless keys %{$thread};
|
||||
|
||||
return $self->render;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
% layout 'default';
|
||||
% title 'New Remark';
|
||||
<h2 class="page-title"><%= title %></h2>
|
||||
<% if (keys %{$thread}) { =%>
|
||||
<form method="post" class="form-body">
|
||||
<div class="form-field">
|
||||
<% if (my $error = validation->error('author')) { =%>
|
||||
|
@ -49,7 +50,8 @@
|
|||
</div>
|
||||
</article>
|
||||
</section>
|
||||
<% if (my $last_remark_id = $last_remark->{'id'}) { =%>
|
||||
<% } =%>
|
||||
<% if (keys %{$last_remark}) { =%>
|
||||
<section class="pager">
|
||||
<h3 class="pager__title">Last Remark</h3>
|
||||
<article class="post">
|
||||
|
@ -57,8 +59,8 @@
|
|||
<span>
|
||||
<%= $last_remark->{'date'} %>
|
||||
</span>
|
||||
<%= link_to "#$last_remark_id", single_remark =>
|
||||
{remark_id => $last_remark_id}, (class => 'post__id') %>
|
||||
<%= link_to "#$last_remark->{'id'}", single_remark =>
|
||||
{remark_id => $last_remark->{'id'}}, (class => 'post__id') %>
|
||||
</h4>
|
||||
<h5 class="post__author"><%= $last_remark->{'author'} %></h5>
|
||||
<div class="post__body">
|
||||
|
|
Loading…
Reference in a new issue