Implement hyperlinking to single-thread view

This commit is contained in:
swaggboi 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 Install dependencies
$ cpanm --installdeps . cpanm --installdeps .
## Running locally ## Running locally
Run it in development mode Run it in development mode
$ morbo PostText.pl morbo PostText.pl
Now try requesting http://localhost:3000 Now try requesting http://localhost:3000
@ -20,9 +20,14 @@ Now try requesting http://localhost:3000
Run the tests locally (against development environment) Run the tests locally (against development environment)
$ prove -l prove -l
## TODOs ## TODOs
1. Add hyperlink somewhere to single thread view (whoopsie) 1. Paging for remarks in single thread view
1. Paging for replies 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"> <div class="threads">
<% for my $thread (@$threads) { =%> <% for my $thread (@$threads) { =%>
<article class="thread"> <article class="thread">
<span><%= link_to '#' . %$thread{'id'}, '/thread/' . %$thread{'id'} %></span>
<h3 class="title"><%= %$thread{'title'} %></h3> <h3 class="title"><%= %$thread{'title'} %></h3>
<h4 class="date"><%= %$thread{'date'} %></h4> <h4 class="date"><%= %$thread{'date'} %></h4>
<h5 class="author"><%= %$thread{'author'} %></h5> <h5 class="author"><%= %$thread{'author'} %></h5>