Remove this hard-coded path stuff

This commit is contained in:
swagg boi 2022-08-22 16:37:38 -04:00
parent 7b74dbe787
commit 8ea06cf0eb
2 changed files with 9 additions and 1 deletions

View file

@ -45,7 +45,7 @@ group {
under 'view';
get '/:page', [page => qr/[0-9]+/], {page => 1}, sub ($c) {
my $base_path = '/view';
my $base_path = $c->match->path_for(page => undef)->{'path'};
my $this_page = $c->param('page');
my $last_page = $c->thread->get_last_page();
my $threads = $c->thread->get_threads_by_page($this_page);
@ -128,6 +128,10 @@ if (my $threads_per_page = app->config->{'threads_per_page'}) {
app->thread->threads_per_page($threads_per_page);
}
if (my $remarks_per_page = app->config->{'remarks_per_page'}) {
app->remark->remarks_per_page($remarks_per_page);
}
app->asset->process('main.css', 'css/PostText.css');
# Send it

View file

@ -29,4 +29,8 @@ sub get_remarks_by_thread_id($self, $thread_id) {
END_SQL
}
sub remarks_per_page($self, $value = undef) {
$self->{'remarks_per_page'} = $value // $self->{'remarks_per_page'};
}
1;