A lil cleanup

This commit is contained in:
swaggboi 2022-08-24 00:21:18 -04:00
parent d9bbcf6bae
commit 4576163015
3 changed files with 22 additions and 24 deletions

View File

@ -121,7 +121,7 @@ group {
# Gotta be a better way to name this route... # Gotta be a better way to name this route...
return $c->redirect_to( return $c->redirect_to(
'thread_idremark_page', 'remark_page',
{thread_id => $thread_id} {thread_id => $thread_id}
); );
} }
@ -137,11 +137,10 @@ group {
# Thread # Thread
group { group {
under '/thread'; under '/thread/:thread_id', [thread_id => qr/[0-9]+/];
# This desperately needs clean-up get '/:remark_page',
get '/:thread_id/:remark_page', [remark_page => qr/[0-9]+/],
[thread_id => qr/[0-9]+/, remark_page => qr/[0-9]+/],
{remark_page => 1}, sub ($c) { {remark_page => 1}, sub ($c) {
my $thread_id = $c->param('thread_id'); my $thread_id = $c->param('thread_id');
my $thread = $c->thread->get_thread_by_id($thread_id); my $thread = $c->thread->get_thread_by_id($thread_id);

View File

@ -5,8 +5,7 @@
<% for my $thread (@$threads) { =%> <% for my $thread (@$threads) { =%>
<article class="thread"> <article class="thread">
<span class="id"> <span class="id">
<%= link_to "#$thread->{'id'}", <%= link_to "#$thread->{'id'}", remark_page => {thread_id => $thread->{'id'}} %>
thread_idremark_page => {thread_id => $thread->{'id'}} %>
</span> </span>
<h3 class="title"><%= %$thread{'title'} %></h3> <h3 class="title"><%= %$thread{'title'} %></h3>
<h4 class="date"><%= %$thread{'date'} %></h4> <h4 class="date"><%= %$thread{'date'} %></h4>