]>
iEval git - plack-app-gruntmaster.git/blob - lib/Gruntmaster/Page/Ct.pm
1 package Gruntmaster
::Page
::Ct
;
6 use Gruntmaster
::Page
::Base ct
=> 'Contests';
7 our @ISA = qw
/Gruntmaster::Page::Base/;
8 our $VERSION = '0.001';
10 use constant TEMPLATES
=> {
13 <h1>Running contests</h1>
14 <table border class="table table-bordered table-striped">
16 <tr><th>Name<th>Start date<th>End date<th>Owner
18 <tmpl_loop running><tr><td><a href="<tmpl_var id>"><tmpl_var name></a>
27 <h1>Pending contests</h1>
28 <table border class="table table-bordered table-striped">
30 <tr><th>Name<th>Start date<th>End date<th>Owner
32 <tmpl_loop pending><tr><td><a href="<tmpl_var id>"><tmpl_var name></a>
41 <h1>Finished contests</h1>
42 <table border class="table table-bordered table-striped">
44 <tr><th>Name<th>Start date<th>End date<th>Owner
46 <tmpl_loop finished><tr><td><a href="<tmpl_var id>"><tmpl_var name></a>
57 my ($self, $htc, $lang, $logger) = @_;
58 debug
$logger => "language is '$lang'";
60 my (@running, @pending, @finished);
64 start
=> strftime
('%c', localtime contest_start
),
65 end
=> strftime
('%c', localtime contest_end
),
66 owner
=> contest_owner
};
69 push @pending, $ct if time < contest_start
;
70 push @running, $ct if time >= contest_start
&& time < contest_end
;
71 push @finished, $ct if time > contest_end
;
74 $htc->param(running
=> \
@running) if @running;
75 $htc->param(pending
=> \
@pending) if @pending;
76 $htc->param(finished
=> \
@finished) if @finished;
This page took 0.045011 seconds and 4 git commands to generate.