]>
iEval git - plack-app-gruntmaster.git/blob - Ct.pm
a21bf77809d352a78ef06c358833c3467945cda9
1 package Gruntmaster
::Page
::Ct
;
6 use Gruntmaster
::Page
::Base ct
=> 'Contests';
7 our @ISA = qw
/Gruntmaster::Page::Base/;
8 our $VERSION = '0.001';
11 my ($self, $htc, $lang, $env) = @_;
12 debug
$env => "language is '$lang'";
14 my (@running, @pending, @finished);
15 for (sort {contest_start
$a <=> contest_start
$b}contests
) {
18 start
=> strftime
('%c', localtime contest_start
),
19 end
=> strftime
('%c', localtime contest_end
),
20 owner
=> contest_owner
};
23 push @pending, $ct if time < contest_start
;
24 push @running, $ct if time >= contest_start
&& time < contest_end
;
25 push @finished, $ct if time > contest_end
;
28 $htc->param(running
=> \
@running) if @running;
29 $htc->param(pending
=> \
@pending) if @pending;
30 $htc->param(finished
=> \
@finished) if @finished;
This page took 0.051421 seconds and 3 git commands to generate.