]> iEval git - gruntmaster-page.git/blobdiff - lib/Gruntmaster/Page/Log/Entry.pm
Add contest/multispace support
[gruntmaster-page.git] / lib / Gruntmaster / Page / Log / Entry.pm
index 08230bfaf8fa475895960943e58a5aa5dd98e340..4b7a70df732b645b4622988941d8278d9c53a5e9 100644 (file)
@@ -33,19 +33,20 @@ $templates{$_} .= footer $_ for keys %templates;
 
 sub generate{
   my ($path, $lang) = @_;
-  $path = ($path =~ m,log/(.*)/index,)[0];
+  $id = ($path =~ m,log/(.*)/index,)[0];
+  $path =~ s,/index\.html,,;
   my $template = $templates{$lang};
 
   my $htc = HTML::Template::Compiled->new(scalarref => \$template);
-  flock my $metafh = IO::File->new("<log/$path/meta.yml"), LOCK_SH;
-  my $meta = LoadFile "log/$path/meta.yml";
+  flock my $metafh = IO::File->new("<$path/meta.yml"), LOCK_SH;
+  my $meta = LoadFile "$path/meta.yml";
 
   my @tests = map {
        $_->{time} = sprintf "%.4fs", $_->{time};
        $_
   } @{$meta->{results}};
 
-  $htc->param(id => $path);
+  $htc->param(id => $id);
   $htc->param(tests => \@tests);
   $htc->output
 }
This page took 0.019323 seconds and 4 git commands to generate.