From: Marius Gavrilescu Date: Fri, 12 Dec 2014 16:17:42 +0000 (+0200) Subject: Add a Track user link on us_entry X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=f1c090e7ae6e91f4fcaa690466524adb94afdf08;p=plack-app-gruntmaster.git Add a Track user link on us_entry --- diff --git a/js/90-tracker.js b/js/90-tracker.js index 812a477..a475ee8 100644 --- a/js/90-tracker.js +++ b/js/90-tracker.js @@ -98,6 +98,8 @@ $('#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')); diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index 6921981..f0952cf 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -79,6 +79,7 @@ sub process_skel { 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}}; diff --git a/tmpl/us_entry.en b/tmpl/us_entry.en index 62748d5..65fb98f 100644 --- a/tmpl/us_entry.en +++ b/tmpl/us_entry.en @@ -4,6 +4,10 @@
Level
Level
+
+Job log
+Owned problems +

Solved problems

Total 1 @@ -17,6 +21,3 @@ Total 1 ContestScoreRank Test10001 - -Job log
-Owned problems