s/view/list/g

This commit is contained in:
swaggboi 2022-08-24 00:48:48 -04:00
parent 8a99330eeb
commit 6ee158a89e
5 changed files with 11 additions and 12 deletions

View File

@ -38,15 +38,15 @@ under sub ($c) {
}; };
# Root # Root
get '/', sub ($c) { $c->redirect_to('view') }; get '/', sub ($c) { $c->redirect_to('list') };
# View # List
group { group {
under 'view'; under 'list';
get '/:view_page', [view_page => qr/[0-9]+/], {view_page => 1}, sub ($c) { get '/:list_page', [list_page => qr/[0-9]+/], {list_page => 1}, sub ($c) {
my $base_path = $c->match->path_for(view_page => undef)->{'path'}; my $base_path = $c->match->path_for(list_page => undef)->{'path'};
my $this_page = $c->param('view_page'); my $this_page = $c->param('list_page');
my $last_page = $c->thread->get_last_page(); my $last_page = $c->thread->get_last_page();
my $threads = $c->thread->get_threads_by_page($this_page); my $threads = $c->thread->get_threads_by_page($this_page);
@ -87,7 +87,7 @@ group {
$thread_body $thread_body
); );
return $c->redirect_to('view'); return $c->redirect_to('list');
} }
} }

View File

@ -24,9 +24,8 @@ Run the tests locally (against development environment)
## TODOs ## TODOs
1. Is there something I can do about route names?
1. Tests for remark form 1. Tests for remark form
1. Fix tests broken when 'view' was switched to 'list'
1. Return the last remark with remark form 1. Return the last remark with remark form
1. Marked some items for clean up with comments 1. Marked some items for clean up with comments
1. Method names may need to be shortened 1. Method names may need to be shortened
1. Change 'view' to something like 'list' or 'browse'

View File

@ -7,7 +7,7 @@
<body> <body>
<h1>Post::Text</h1> <h1>Post::Text</h1>
<nav> <nav>
<%= link_to View => 'view' %> <%= link_to List => 'list' %>
<%= link_to New => 'post' %> <%= link_to New => 'post' %>
</nav> </nav>
<hr> <hr>

View File

@ -1,5 +1,5 @@
% layout 'main'; % layout 'main';
% title 'View Threads'; % title 'Threads List';
<h2><%= title %></h2> <h2><%= title %></h2>
<div class="threads"> <div class="threads">
<% for my $thread (@$threads) { =%> <% for my $thread (@$threads) { =%>

View File

@ -1,5 +1,5 @@
% layout 'main'; % layout 'main';
% title "View Thread - #$thread->{'id'}"; % title "Thread - #$thread->{'id'}";
<h2><%= title %></h2> <h2><%= title %></h2>
<div class="threads"> <div class="threads">
<article class="thread"> <article class="thread">