nav li{
padding: 5px;
}
+
+ul.inline{
+ list-style-type: none;
+}
+
+ul.inline li{
+ display: inline;
+}
+
+ul.inline li:after {
+ content: ", ";
+}
+
+ul.inline li:last-child:after {
+ content: "";
+}
\ No newline at end of file
sub process_us_entry {
my ($tree, %args) = @_;
$tree->fid($_)->attr('href', "/$_/?owner=$args{id}") for qw/log pb/;
+ my @solved = map { $_->{solved} ? ($_->{problem}) : () } @{$args{problems}};
+ my @attempted = map { !$_->{solved} ? ($_->{problem}) : () } @{$args{problems}};
+
+ my $pbiter = sub {
+ my ($data, $li) = @_;
+ $li->find('a')->namedlink($data);
+ };
+ $tree->fid('solved')->find('li')->iter3(\@solved, $pbiter);
+ $tree->fid('attempted')->find('li')->iter3(\@attempted, $pbiter);
+ $tree->fid('solved_count')->replace_content(scalar @solved);
+ $tree->fid('attempted_count')->replace_content(scalar @attempted);
+
+ my $ctiter = sub {
+ my ($data, $td) = @_;
+ $td->fclass('contest')->namedlink($data->{contest});
+ $td->fclass('score')->replace_content($data->{score});
+ $td->fclass('rank')->replace_content($data->{rank});
+ };
+ $tree->find('table')->find('tbody')->find('tr')->iter3($args{contests}, $ctiter);
}
sub process_us {
<dt>Level</dt> <dd smap="level">Level</dd>
</dl>
+<h1>Solved problems</h1>
+Total <strong id="solved_count">1</strong>
+<ul class="inline" id="solved"><li><a href="/pb/id">problem_id</a></ul>
+
+<h1>Attempted problems</h1>
+Total <strong id="attempted_count">1</strong>
+<ul class="inline" id="attempted"><li><a href="/pb/id">problem_id</a></ul>
+
+<h1>Contest results</h1>
+<table class="table table-bordered table-striped">
+<thead><tr><th>Contest<th>Score<th>Rank</thead>
+<tbody><tr><td class="contest"><a href="/ct/id">Test<td class="score">1000<td class="rank">1</tbody>
+</table>
+
<a href="/log/?owner=id" id="log">Job log</a><br>
<a href="/pb/?owner=id" id="pb">Owned problems</a>