<%= %$thread{'title'} %>
+<%= %$thread{'date'} %>
+<%= %$thread{'author'} %>
+<%= %$thread{'body'} %>
+diff --git a/PostText.pl b/PostText.pl index 9b1fa12..f92637a 100755 --- a/PostText.pl +++ b/PostText.pl @@ -63,9 +63,7 @@ group { # Post group { - under '/post'; - - any [qw{GET POST}], '/', sub ($c) { + any [qw{GET POST}], '/post', sub ($c) { my $v; $v = $c->validation() if $c->req->method eq 'POST'; @@ -93,9 +91,11 @@ group { } } - return $c->render(template => 'post_thread'); + return $c->render(); }; + under '/post'; + any [qw{GET POST}], '/:thread_id', [thread_id => qr/[0-9]+/], sub ($c) { my ($thread_id, $v) = ($c->param('thread_id'), undef); @@ -131,7 +131,7 @@ group { $c->stash(thread => $thread); - return $c->render(template => 'post_remark'); + return $c->render(); }; }; @@ -166,7 +166,7 @@ group { ) } - $c->render(template => 'thread_id'); + $c->render(); }; }; diff --git a/templates/post.html.ep b/templates/post.html.ep new file mode 100644 index 0000000..aef4b41 --- /dev/null +++ b/templates/post.html.ep @@ -0,0 +1,32 @@ +% layout 'main'; +% title 'New Thread'; +
<%= %$thread{'body'} %>
+<%= %$remark{'body'} %>
+<%= %$thread{'body'} %>
<%= %$remark{'body'} %>
-