$('#tracker').detach().prependTo($('#sidebar')).removeClass('hidden');
$('#tracker_button').on('click', function() { start_tracking($('#tracker_username').val()) });
$('#tracker_stop').on('click', stop_tracking);
+ $('#track_user').removeClass('hidden');
+ $('#track_user').on('click', function() { stop_tracking(); start_tracking($(this).data('user')) });
if(localStorage.getItem('tracker_username'))
start_tracking(localStorage.getItem('tracker_username'));
sub process_us_entry {
my ($tree, %args) = @_;
$tree->fid($_)->attr('href', "/$_/?owner=$args{id}") for qw/log pb/;
+ $tree->fid('track_user')->attr('data-user', $args{id});
my @solved = map { $_->{solved} ? ($_->{problem}) : () } @{$args{problems}};
my @attempted = map { !$_->{solved} ? ($_->{problem}) : () } @{$args{problems}};
<dt>Level</dt> <dd smap="level">Level</dd>
</dl>
+<a href="#" id="track_user" data-user="id" class="hidden">Track user</a><br>
+<a href="/log/?owner=id" id="log">Job log</a><br>
+<a href="/pb/?owner=id" id="pb">Owned problems</a>
+
<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>
<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>