]> iEval git - gruntmaster-data.git/blobdiff - lib/Gruntmaster/Data.pm
Set JOBS_PER_PAGE to 50
[gruntmaster-data.git] / lib / Gruntmaster / Data.pm
index fbfabcff39fc6a7d67f325f0662d0d90fba83f12..50dcfd57d1a407e8da7611515b3691fe66ae0b4f 100644 (file)
@@ -28,7 +28,7 @@ use Sub::Name qw/subname/;
 use constant CONTEST_PUBLIC_COLUMNS => [qw/id name description start stop owner/];
 use constant PROBLEM_PUBLIC_COLUMNS => [qw/id author writer level name owner private timeout olimit value/];
 use constant USER_PUBLIC_COLUMNS => [qw/id admin name town university country level/];
-use constant JOBS_PER_PAGE => 10;
+use constant JOBS_PER_PAGE => 50;
 
 sub dynsub{
        our ($name, $sub) = @_;
@@ -56,14 +56,16 @@ sub user_list {
        }
        $contests{$_->rawowner}++ for $self->contest_statuses->all;
 
-       [ sort { $b->{solved} <=> $a->{solved} or $b->{attempted} <=> $a->{attempted} } ## no critic (ProhibitReverseSort)
-               grep { $_->{solved} || $_->{attempted} } map {
+       my @users = sort { $b->{solved} <=> $a->{solved} or $b->{attempted} <=> $a->{attempted} } ## no critic (ProhibitReverseSort)
+               map {
                        my $id = $_->id;
                        +{ $_->get_columns,
                           solved => ($solved{$id} // 0),
                           attempted => ($attempted{$id} // 0),
                           contests => ($contests{$id} // 0) }
-               } $rs->all ]
+               } $rs->all;
+       @users = @users[0 .. 199] if @users > 200;
+       \@users
 }
 
 sub user_entry {
This page took 0.023004 seconds and 4 git commands to generate.