From: Marius Gavrilescu Date: Fri, 28 Feb 2014 10:08:25 +0000 (+0200) Subject: Add links and full names to usernames in tables X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=e3ab4b036900e0ae2f0b0a39641b2aed82fce8f5;p=plack-app-gruntmaster.git Add links and full names to usernames in tables --- diff --git a/lib/Gruntmaster/Page/Generic.pm b/lib/Gruntmaster/Page/Generic.pm index 95d1cd8..3fdd47c 100644 --- a/lib/Gruntmaster/Page/Generic.pm +++ b/lib/Gruntmaster/Page/Generic.pm @@ -109,19 +109,20 @@ thing { contest; sortby { $a->{name} cmp $b->{name} }; group { $_->{level} }; + mangle { $_->{owner_name} = do { local $Gruntmaster::Data::contest; user_name $_->{owner} } } }; thing { params qw/ct contest Contests/; sortby { $a->{start} <=> $b->{start} }; group { time < $_->{start} ? 'pending' : time > $_->{end} ? 'finished' : 'running' }; - mangle { $_->{started} = time >= $_->{start} }; + mangle { $_->{started} = time >= $_->{start}; $_->{owner_name} = do { local $Gruntmaster::Data::contest; user_name $_->{owner} } }; }; thing { params qw/log job/, 'Job log'; contest; - mangle { $_->{results} &&= decode_json $_->{results}; } + mangle { $_->{results} &&= decode_json $_->{results}; $_->{user_name} = do { local $Gruntmaster::Data::contest; user_name $_->{user} } } }; 1 diff --git a/lib/Gruntmaster/Page/Log.pm b/lib/Gruntmaster/Page/Log.pm index 7fe8885..f63f832 100644 --- a/lib/Gruntmaster/Page/Log.pm +++ b/lib/Gruntmaster/Page/Log.pm @@ -19,6 +19,7 @@ sub _generate{ date => (job_date() ? strftime ('%c' => localtime job_date) : '?'), extension => job_extension, name => problem_name job_problem, + user_name => do { local $Gruntmaster::Data::contest; user_name job_user }, problem => job_problem, result => job_result, result_text => job_result_text, diff --git a/tmpl/ct.en b/tmpl/ct.en index 045bf74..d39bbcb 100644 --- a/tmpl/ct.en +++ b/tmpl/ct.en @@ -7,7 +7,7 @@ <%perl __OUT__ POSIX::strftime '%c', localtime __CURRENT__->{start}; %> <%perl __OUT__ POSIX::strftime '%c', localtime __CURRENT__->{end}; %> - + () @@ -21,7 +21,7 @@ <%perl __OUT__ POSIX::strftime '%c', localtime __CURRENT__->{start}; %> <%perl __OUT__ POSIX::strftime '%c', localtime __CURRENT__->{end}; %> - + () @@ -35,7 +35,7 @@ <%perl __OUT__ POSIX::strftime '%c', localtime __CURRENT__->{start}; %> <%perl __OUT__ POSIX::strftime '%c', localtime __CURRENT__->{end}; %> - + () diff --git a/tmpl/log.en b/tmpl/log.en index 2ef59af..de918a2 100644 --- a/tmpl/log.en +++ b/tmpl/log.en @@ -6,7 +6,7 @@ data-private> - + () diff --git a/tmpl/pb.en b/tmpl/pb.en index 00569df..341ffbe 100644 --- a/tmpl/pb.en +++ b/tmpl/pb.en @@ -3,7 +3,7 @@ -
NameAuthorOwner
+
()
@@ -13,7 +13,7 @@ -
NameAuthorOwner
+
()
@@ -23,7 +23,7 @@ -
NameAuthorOwner
+
()
@@ -33,7 +33,7 @@ -
NameAuthorOwner
+
()