From 4adba83511419152274b2251a544b1b0d3ebca7b Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 6 Feb 2015 11:00:27 +0200 Subject: [PATCH] Include contest_name in job_list --- lib/Gruntmaster/Data.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index 344885d..bcb3571 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -138,7 +138,7 @@ sub contest_entry { sub job_list { my ($self, %args) = @_; $args{page} //= 1; - my $rs = $self->jobs->search(undef, {order_by => {-desc => 'me.id'}, prefetch => ['problem', 'owner'], rows => JOBS_PER_PAGE, page => $args{page}}); + my $rs = $self->jobs->search(undef, {order_by => {-desc => 'me.id'}, prefetch => ['problem', 'owner', 'contest'], rows => JOBS_PER_PAGE, page => $args{page}}); $rs = $rs->search({contest => $args{contest} || undef}) if exists $args{contest}; $rs = $rs->search({'me.private'=> 0}) unless $args{private}; $rs = $rs->search({'me.owner' => $args{owner}}) if $args{owner}; @@ -148,6 +148,7 @@ sub job_list { my %params = $_->get_columns; $params{owner_name} = $_->owner->name; $params{problem_name} = $_->problem->name; + $params{contest_name} = $_->contest->name if $params{contest}; $params{results} &&= decode_json $params{results}; $params{size} = length $params{source}; delete $params{source}; -- 2.39.2