From 4fffff7c5a0669e2860cf1428f8f4c4f9fddabea Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 28 Feb 2014 09:41:40 +0200 Subject: [PATCH] Show full names and usernames in standings --- lib/Gruntmaster/Page/St.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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, -- 2.39.2