Fix and update standings
authorMarius Gavrilescu <marius@ieval.ro>
Mon, 27 Jan 2014 13:38:37 +0000 (15:38 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Mon, 27 Jan 2014 13:38:37 +0000 (15:38 +0200)
gruntmaster-genallpages
lib/Gruntmaster/Page.pm
lib/Gruntmaster/Page/St.pm

index 7588f02b65ed54c3510630b569c7e90bb41bd436..ea15578d5a27ff0a3ba033a6233a5a7301584e8b 100755 (executable)
@@ -13,7 +13,6 @@ sub generate{
 
 generate "ct/index.html";
 generate "ct/$_/index.thml" for contests;
-generate "ct/$_/log/st.html" for contests;
 
 generate "us/index.html";
 generate "us/$_.html" for users;
@@ -21,6 +20,7 @@ generate "us/$_.html" for users;
 for my $ct (undef, contests) {
        local $Gruntmaster::Data::contests = $ct;
        my $ctp = defined $ct ? "ct/$ct/" : '';
+       generate "${ctp}log/st.html";
        generate "${ctp}log/index.html";
        my $pagecnt = jobcard / Gruntmaster::Page::Log::PAGE_SIZE;
        generate "${ctp}log/$_.html" for 1 .. $pagecnt;
index 451ed8e3a0a2efbe979f7f510471d56f867500ed..71f517317b1e763d88ffcbdb3883c4820a82b115 100644 (file)
@@ -38,7 +38,7 @@ sub declaregen{
        declaregen 'Us::Entry'          => qr,^us/$component$,;
        declaregen Ct                           => qr,^ct/index$,;
        declaregen 'Ct::Entry'          => qr,^ct/$component/index$,;
-       declaregen St                           => qr,^ct/$component/log/st$,;
+       declaregen St                           => qr,^${contest}log/st$,;
        declaregen Log                          => qr,^${contest}log/(?:\d+|index)$,;
        declaregen 'Log::Entry' => qr,^${contest}log/job/$component$,;
        declaregen Submit                       => qr,^${contest}submit$,;
index dafd5df249e21b1604441d1ba0033e12b4a3080c..b91137e883f2f45cfea0933b3ed58db83970994a 100644 (file)
@@ -7,7 +7,7 @@ use Gruntmaster::Page::Base st => 'Standings';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant => TEMPLATES => {
+use constant TEMPLATES => {
        en => <<'HTML',
 <table border>
 <thead>
@@ -24,9 +24,11 @@ HTML
 sub _generate{
        my ($self, $htc, $path, $lang) = @_;
 
-       local $Gruntmaster::Data::contest = ($path =~ m,^ct/([^/]+)/,)[0];
+       $path =~ m,^(?:ct/([^/]+)/)?,;
+       local $Gruntmaster::Data::contest = $1;
 
-       my @problems = sort problems;
+       my @problems = problems;
+       @problems = sort @problems;
        my %scores;
        for (1 .. jobcard) {
                if (job_result_text =~ m/^(\d+)/) {
@@ -44,7 +46,7 @@ sub _generate{
                        scores => [map { $scores{$user}{$_} // '-'} @problems],
                }
        } keys %scores;
-       $htc->param(problems => \@problems);
+       $htc->param(problems => [map { problem_name } @problems ]);
        $htc->param(st => \@st);
 }
 
This page took 0.012788 seconds and 4 git commands to generate.