Sort problems in standings by value and fix standings JSON
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 25 Jan 2015 11:34:23 +0000 (13:34 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 25 Jan 2015 11:34:23 +0000 (13:34 +0200)
lib/Plack/App/Gruntmaster.pm
lib/Plack/App/Gruntmaster/HTML.pm

index 991159bf02bef79973aeeac2f6659c78002ab0c8..efcedf54a23e74f79fae336dfa64733b020df16d 100644 (file)
@@ -144,7 +144,10 @@ sub dispatch_request{
                sub (/st/:contest) {
                        response st => 'Standings', {
                                st => [ contest->standings ],
-                               problems => [map { $_->problem } contest->contest_problems],
+                               problems => [
+                                       map { [$_->id, $_->name] }
+                                       sort { $a->value <=> $b->value }
+                                       map { $_->problem } contest->contest_problems],
                        }, 10
                },
 
index 91699e6e7e96f3bb64698403750750ebfee0d992..e84f6003d70a54f7972a24dfc61911a23e185d20 100644 (file)
@@ -243,7 +243,7 @@ sub process_st {
        my $pbiter = sub {
                my ($data, $th) = @_;
                $th->attr(class => undef);
-               $th->namedlink($data->id, $data->name);
+               $th->namedlink(@$data);
        };
        $tree->fclass('problem')->iter3($args{problems}, $pbiter);
        my $iter = sub {
This page took 0.012202 seconds and 4 git commands to generate.