From 5635d73d89f691508965dfea27fb8d75233d5a1b Mon Sep 17 00:00:00 2001 From: swag Date: Fri, 26 May 2023 22:56:22 -0400 Subject: [PATCH] Some cleanup and /new route for new session --- lib/PostText.pm | 7 +++++++ templates/remark/create.html.ep | 13 ++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/PostText.pm b/lib/PostText.pm index fa47d78..05fb4ae 100644 --- a/lib/PostText.pm +++ b/lib/PostText.pm @@ -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'); diff --git a/templates/remark/create.html.ep b/templates/remark/create.html.ep index 33c2044..df4bd33 100644 --- a/templates/remark/create.html.ep +++ b/templates/remark/create.html.ep @@ -34,13 +34,11 @@

Thread

- <%= link_to single_thread => {thread_id => $thread->{'id'}}, begin %> + <%= $thread->{'title'} %> - <% end %> - - <%= link_to "#$thread->{'id'}", - single_thread => {thread_id => $thread->{'id'}} %> + <%= link_to "#$thread->{'id'}", single_thread => + {thread_id => $thread->{'id'}}, (class => 'post__id') %>

@@ -54,8 +52,9 @@

Last Remark

- <%= link_to $last_remark->{'date'}, single_remark => - {remark_id => $last_remark_id} %> + + <%= $last_remark->{'date'} %> + <%= link_to "#$last_remark_id", single_remark => {remark_id => $last_remark_id}, (class => 'post__id') %>