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 {
-<div class="list-group">
-<a class="list-group-item" href="/us/id">Name</a>
-<div>
+<table border class="table table-bordered table-striped">
+<thead><tr><th>User<th>Solved problems<th>Attempted problems<th>Attended contests</thead>
+<tbody><tr><td class="user"><a href="/us/id">Name</a><td class="solved">10<td class="attempted">5<td class="contests">1
+</table>