]> iEval git - gruntmaster-page.git/blobdiff - lib/Gruntmaster/Page/Pb.pm
Add example test suite
[gruntmaster-page.git] / lib / Gruntmaster / Page / Pb.pm
index 8e4a40886e26d329c6a113d84e97ed209ecd6f19..ba78869c5f763fbafcc40a1c187379117f37df1a 100644 (file)
@@ -7,42 +7,10 @@ use Gruntmaster::Page::Base pb => 'Problems';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant TEMPLATES => {
-       en => <<'HTML',
-<tmpl_if levels>
-<h2>Beginner</h2>
-<ul>
-<tmpl_loop beginner><li><a href="<tmpl_var id>.var"><tmpl_var name></a>
-</tmpl_loop></ul>
-
-<h2>Easy</h2>
-<ul>
-<tmpl_loop easy><li><a href="<tmpl_var id>.var"><tmpl_var name></a>
-</tmpl_loop></ul>
-
-<h2>Medium</h2>
-<ul>
-<tmpl_loop medium><li><a href="<tmpl_var id>.var"><tmpl_var name></a>
-</tmpl_loop></ul>
-
-<h2>Hard</h2>
-<ul>
-<tmpl_loop hard><li><a href="<tmpl_var id>.var"><tmpl_var name></a>
-</tmpl_loop></ul>
-
-<tmpl_else>
-<ul>
-<tmpl_loop problems><li><a href="<tmpl_var id>.var"><tmpl_var name></a>
-</tmpl_loop></ul>
-</tmpl_if>
-HTML
-};
-
 sub _generate{
-       my ($self, $htc, $path, $lang) = @_;
-
-       $path =~ m,^(?:ct/([^/]+)/)?pb/index.html$,;
-       local $Gruntmaster::Data::contest = $1;
+       my ($self, $htc, $lang, $env, $ct) = @_;
+       debug $env => "language is '$lang' and contest is '$ct'";
+       local $Gruntmaster::Data::contest = $ct if $ct;
 
        my @problems = sort { $b->{name} cmp $a->{name} } map +{
                id    => $_,
This page took 0.021476 seconds and 4 git commands to generate.