X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FPb.pm;h=a3902c23676ed296a9e1173105bd7fec3a0d2780;hb=5bbf0128012c09c78462ee49b874f968385b0978;hp=617112a539c99a73a3361e8a4e429914f7078754;hpb=832cb45e325364ca1de645a2256efa69284fcf06;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Pb.pm b/lib/Gruntmaster/Page/Pb.pm index 617112a..a3902c2 100644 --- a/lib/Gruntmaster/Page/Pb.pm +++ b/lib/Gruntmaster/Page/Pb.pm @@ -18,8 +18,24 @@ use Gruntmaster::Page::Common qw/header footer/; my %templates = ( en => <<'HTML', +

Beginner

+ +

Easy

+ + +

Medium

+ + +

Hard

+ HTML ); @@ -37,8 +53,10 @@ sub generate{ my @problems = sort { $b->{name} cmp $a->{name} } map { my $meta = LoadFile $_; my $id = (m,^$path/(.*)/meta.yml$,)[0]; - +{ id => $id, name => $meta->{name} } } <$path/*/meta.yml>; - $htc->param(problems => \@problems); + +{ id => $id, name => $meta->{name}, level => $meta->{level} } } <$path/*/meta.yml>; + for my $d(qw/beginner easy medium advanced hard/) { + $htc->param($d => [grep {$_->{level} eq $d} @problems]); + } $htc->output }