X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FGeneric.pm;h=c54c9fc3d2bc752709f7683195e9467c09df1803;hb=b643b4e844a3d9b9d32dbba977a7cd4181575296;hp=95d1cd8cac6f791d0a73a49ea9f507a6850bcd9c;hpb=81cce380bd7f2ab58bb497ef748b7568968ea05d;p=gruntmaster-page.git diff --git a/lib/Gruntmaster/Page/Generic.pm b/lib/Gruntmaster/Page/Generic.pm index 95d1cd8..c54c9fc 100644 --- a/lib/Gruntmaster/Page/Generic.pm +++ b/lib/Gruntmaster/Page/Generic.pm @@ -109,19 +109,20 @@ thing { contest; sortby { $a->{name} cmp $b->{name} }; group { $_->{level} }; + mangle { $_->{owner_name} = do { local $Gruntmaster::Data::contest; user_name $_->{owner} } } }; thing { params qw/ct contest Contests/; - sortby { $a->{start} <=> $b->{start} }; + sortby { $b->{start} <=> $a->{start} }; group { time < $_->{start} ? 'pending' : time > $_->{end} ? 'finished' : 'running' }; - mangle { $_->{started} = time >= $_->{start} }; + mangle { $_->{started} = time >= $_->{start}; $_->{owner_name} = do { local $Gruntmaster::Data::contest; user_name $_->{owner} } }; }; thing { params qw/log job/, 'Job log'; contest; - mangle { $_->{results} &&= decode_json $_->{results}; } + mangle { $_->{results} &&= decode_json $_->{results}; $_->{user_name} = do { local $Gruntmaster::Data::contest; user_name $_->{user} } } }; 1