File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1010# Load the local modules too
1111use lib ' lib' ;
1212use PostText::Model::Thread;
13+ use PostText::Model::Reply;
1314
1415# Load Mojo plugins
1516plugin ' Config' ;
2526 state $thread = PostText::Model::Thread-> new(pg => shift -> pg)
2627};
2728
29+ helper reply => sub {
30+ state $reply = PostText::Model::Reply-> new(pg => shift -> pg)
31+ };
32+
2833# Begin routing
2934under sub ($c ) {
3035 $c -> session(expires => time () + 31536000);
9499app-> pg-> migrations-> from_dir(' migrations' )-> migrate(4);
95100
96101if (my $threads_per_page = app-> config-> {' threads_per_page' }) {
97- say $threads_per_page ;
98102 app-> thread-> threads_per_page($threads_per_page );
99103}
100104
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Run the tests locally (against development environment)
2424
2525## TODOs
2626
27+ 1 . Make a view for single threads(!!)
27281 . Default 'threads per page' is broken if config file isn't correct
2829 (should pick up the default value wtf)
29301 . Pick a date format
30- 1 . Reply model
Original file line number Diff line number Diff line change 1+ # !/usr/bin/env perl
2+
3+ package PostText::Model::Reply ;
4+
5+ use Mojo::Base -base, -signatures;
6+
7+ has ' pg' ;
8+
9+ sub new ($class , $pg , $pg_reference ) {
10+ bless {
11+ $pg => $pg_reference ,
12+ replies_per_page => 5
13+ }, $class
14+ }
15+
16+ 1;
You can’t perform that action at this time.
0 commit comments