From c5ff0b0939c991eadcd5c9026268bcd0f12c8a45 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 12 Dec 2014 15:18:11 +0200 Subject: [PATCH] Greatly improve user list --- lib/Plack/App/Gruntmaster/HTML.pm | 13 ++++++------- tmpl/us.en | 7 ++++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index 2ae8a44..26669c7 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -102,13 +102,12 @@ sub process_us_entry { sub process_us { my ($tree, %args) = @_; - my $item = $tree->fclass('list-group-item'); - $item->replace_with(map { - my $new = $item->clone; - $new->attr(href => $_->{id}); - $new->replace_content($_->{name} || $_->{id}); - $new - } @{$args{us}}); + my $iter = sub { + my ($data, $tr) = @_; + $tr->fclass('user')->namedlink($data->{id}, $data->{name}); + $tr->fclass($_)->replace_content($data->{$_}) for qw/solved attempted contests/; + }; + $tree->find('tbody')->find('tr')->iter3($args{us}, $iter); } sub process_ct_entry { diff --git a/tmpl/us.en b/tmpl/us.en index dad8844..2d9f541 100644 --- a/tmpl/us.en +++ b/tmpl/us.en @@ -1,3 +1,4 @@ -
-Name -
+ + +
UserSolved problemsAttempted problemsAttended contests
Name1051 +
-- 2.30.2