diff --git a/PostText.pl b/PostText.pl index f92637a..2576a2f 100755 --- a/PostText.pl +++ b/PostText.pl @@ -38,15 +38,15 @@ under sub ($c) { }; # Root -get '/', sub ($c) { $c->redirect_to('view') }; +get '/', sub ($c) { $c->redirect_to('list') }; -# View +# List group { - under 'view'; + under 'list'; - get '/:view_page', [view_page => qr/[0-9]+/], {view_page => 1}, sub ($c) { - my $base_path = $c->match->path_for(view_page => undef)->{'path'}; - my $this_page = $c->param('view_page'); + get '/:list_page', [list_page => qr/[0-9]+/], {list_page => 1}, sub ($c) { + my $base_path = $c->match->path_for(list_page => undef)->{'path'}; + my $this_page = $c->param('list_page'); my $last_page = $c->thread->get_last_page(); my $threads = $c->thread->get_threads_by_page($this_page); @@ -87,7 +87,7 @@ group { $thread_body ); - return $c->redirect_to('view'); + return $c->redirect_to('list'); } } diff --git a/README.md b/README.md index a8634cb..65d31e1 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,8 @@ Run the tests locally (against development environment) ## TODOs -1. Is there something I can do about route names? 1. Tests for remark form +1. Fix tests broken when 'view' was switched to 'list' 1. Return the last remark with remark form 1. Marked some items for clean up with comments 1. Method names may need to be shortened -1. Change 'view' to something like 'list' or 'browse' diff --git a/templates/layouts/main.html.ep b/templates/layouts/main.html.ep index 9bc1b70..2efd096 100644 --- a/templates/layouts/main.html.ep +++ b/templates/layouts/main.html.ep @@ -7,7 +7,7 @@

Post::Text


diff --git a/templates/view_page.html.ep b/templates/list_page.html.ep similarity index 96% rename from templates/view_page.html.ep rename to templates/list_page.html.ep index 440d5ce..d3c495b 100644 --- a/templates/view_page.html.ep +++ b/templates/list_page.html.ep @@ -1,5 +1,5 @@ % layout 'main'; -% title 'View Threads'; +% title 'Threads List';

<%= title %>

<% for my $thread (@$threads) { =%> diff --git a/templates/remark_page.html.ep b/templates/remark_page.html.ep index 175afa0..2531acd 100644 --- a/templates/remark_page.html.ep +++ b/templates/remark_page.html.ep @@ -1,5 +1,5 @@ % layout 'main'; -% title "View Thread - #$thread->{'id'}"; +% title "Thread - #$thread->{'id'}";

<%= title %>