Some cleanup and /new route for new session

This commit is contained in:
swag 2023-05-26 22:56:22 -04:00
parent 5f0f32c443
commit 5635d73d89
2 changed files with 13 additions and 7 deletions

View File

@ -110,6 +110,13 @@ sub startup($self) {
# Root redirect
$r->get('/', sub ($c) { $c->redirect_to('threads_list') });
# Shortcut to new session cookie/identity
$r->get('/new', sub ($c) {
$c->session(expires => 1);
$c->redirect_to('threads_list');
});
# Static pages
$r->get('/about')->to('page#about')->name('about_page');

View File

@ -34,13 +34,11 @@
<h3 class="page-title">Thread</h3>
<article class="post">
<h3 class="post__title">
<%= link_to single_thread => {thread_id => $thread->{'id'}}, begin %>
<span>
<%= $thread->{'title'} %>
<% end %>
<span class="post__id">
<%= link_to "#$thread->{'id'}",
single_thread => {thread_id => $thread->{'id'}} %>
</span>
<%= link_to "#$thread->{'id'}", single_thread =>
{thread_id => $thread->{'id'}}, (class => 'post__id') %>
</h3>
<h4 class="post__date"><%= $thread->{'date'} %></h4>
<h5 class="post__author"><%= $thread->{'author'} %></h5>
@ -54,8 +52,9 @@
<h3 class="page-title">Last Remark</h3>
<article class="post">
<h4 class="post__title">
<%= link_to $last_remark->{'date'}, single_remark =>
{remark_id => $last_remark_id} %>
<span>
<%= $last_remark->{'date'} %>
</span>
<%= link_to "#$last_remark_id", single_remark =>
{remark_id => $last_remark_id}, (class => 'post__id') %>
</h4>