]>
iEval git - gruntmaster-page.git/blob - lib/Gruntmaster/Page/Pb.pm
1 package Gruntmaster
::Page
::Pb
;
6 use Gruntmaster
::Page
::Base pb
=> 'Problems';
7 our @ISA = qw
/Gruntmaster::Page::Base/;
8 our $VERSION = '0.001';
10 use constant TEMPLATES
=> {
14 <div class="list-group">
15 <tmpl_loop beginner><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
19 <div class="list-group">
20 <tmpl_loop easy><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
24 <div class="list-group">
25 <tmpl_loop medium><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
29 <div class="list-group">
30 <tmpl_loop hard><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
34 <div class="list-group">
35 <tmpl_loop problems><a class="list-group-item" href="<tmpl_var id>"><tmpl_var name></a>
42 my ($self, $htc, $lang, $env, $ct) = @_;
43 debug
$env => "language is '$lang' and contest is '$ct'";
44 local $Gruntmaster::Data
::contest
= $ct if $ct;
46 my @problems = sort { $b->{name
} cmp $a->{name
} } map +{
49 level
=> problem_level
}, problems
;
51 for my $d (qw
/beginner easy medium advanced hard/) {
52 $htc->param($d => [grep {$_->{level
} and $_->{level
} eq $d} @problems]);
54 $htc->param(levels
=> grep { $_->{level
} } @problems);
55 $htc->param(problems
=> \
@problems);
This page took 0.053096 seconds and 4 git commands to generate.