Implement hyperlinking to single-thread view

This commit is contained in:
swagg boi 2022-08-22 17:33:15 -04:00
parent 8ea06cf0eb
commit ab9b055047
2 changed files with 11 additions and 5 deletions

View file

@ -6,13 +6,13 @@ A textboard written in Perl
Install dependencies
$ cpanm --installdeps .
cpanm --installdeps .
## Running locally
Run it in development mode
$ morbo PostText.pl
morbo PostText.pl
Now try requesting http://localhost:3000
@ -20,9 +20,14 @@ Now try requesting http://localhost:3000
Run the tests locally (against development environment)
$ prove -l
prove -l
## TODOs
1. Add hyperlink somewhere to single thread view (whoopsie)
1. Paging for replies in single thread view
1. Paging for remarks in single thread view
1. Form to create new remarks
1. I'm kinda hardcoding the single-thread view `link_to` in the
templates because I cannot for the life of me figure out how to use
`url_for` to populate the `thread_id` placeholder. Probably need to
clean-up the HTML too, just used `<span>` cuz I didn't know what
else to use

View file

@ -4,6 +4,7 @@
<div class="threads">
<% for my $thread (@$threads) { =%>
<article class="thread">
<span><%= link_to '#' . %$thread{'id'}, '/thread/' . %$thread{'id'} %></span>
<h3 class="title"><%= %$thread{'title'} %></h3>
<h4 class="date"><%= %$thread{'date'} %></h4>
<h5 class="author"><%= %$thread{'author'} %></h5>