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...
return $c->redirect_to(
'thread_idremark_page',
'remark_page',
{thread_id => $thread_id}
);
}
@ -137,11 +137,10 @@ group {
# Thread
group {
under '/thread';
under '/thread/:thread_id', [thread_id => qr/[0-9]+/];
# This desperately needs clean-up
get '/:thread_id/:remark_page',
[thread_id => qr/[0-9]+/, remark_page => qr/[0-9]+/],
get '/:remark_page',
[remark_page => qr/[0-9]+/],
{remark_page => 1}, sub ($c) {
my $thread_id = $c->param('thread_id');
my $thread = $c->thread->get_thread_by_id($thread_id);

View File

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