From: Marius Gavrilescu Date: Fri, 28 Feb 2014 07:41:40 +0000 (+0200) Subject: Show full names and usernames in standings X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=4fffff7c5a0669e2860cf1428f8f4c4f9fddabea;p=plack-app-gruntmaster.git Show full names and usernames in standings --- diff --git a/lib/Gruntmaster/Page/St.pm b/lib/Gruntmaster/Page/St.pm index 407e87a..562e467 100644 --- a/lib/Gruntmaster/Page/St.pm +++ b/lib/Gruntmaster/Page/St.pm @@ -27,6 +27,14 @@ sub calc_score{ int $score + 0.5 } +sub usname ($) { + local $Gruntmaster::Data::contest; + my $user = shift; + my $name = user_name $user; + "$name ($user)" +} + + sub _generate{ my ($self, $htc, $lang, $env, $ct) = @_; debug $env => "language is '$lang' and contest is '$ct'"; @@ -58,7 +66,7 @@ sub _generate{ my @st = sort { $b->{score} <=> $a->{score} or $a->{user} cmp $b->{user}} map { my $user = $_; +{ - user => user_name $user, + user => usname $user, score => sum (values $scores{$user}), scores => [map { $scores{$user}{$_} // '-'} @problems], problems => $Gruntmaster::Data::contest,