From: Marius Gavrilescu Date: Fri, 12 Dec 2014 13:18:11 +0000 (+0200) Subject: Greatly improve user list X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=c5ff0b0939c991eadcd5c9026268bcd0f12c8a45;p=plack-app-gruntmaster.git Greatly improve user list --- 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 +