diff options
author | Yorhel <git@yorhel.nl> | 2008-12-14 09:41:49 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-12-14 09:41:49 +0100 |
commit | 930d2d4dd61bd93b47315eb8992bc745d0fa633a (patch) | |
tree | 755921a2af9feccf49d98b6264533791e9199bdf /lib/VNDB/Util/CommonHTML.pm | |
parent | a68203fb523e5b81978fd9618d81342823dd9822 (diff) |
Hide recent votes from VN pages if there aren't any visible votes
Diffstat (limited to 'lib/VNDB/Util/CommonHTML.pm')
-rw-r--r-- | lib/VNDB/Util/CommonHTML.pm | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/lib/VNDB/Util/CommonHTML.pm b/lib/VNDB/Util/CommonHTML.pm index 48d06318..6f85f8bd 100644 --- a/lib/VNDB/Util/CommonHTML.pm +++ b/lib/VNDB/Util/CommonHTML.pm @@ -423,24 +423,26 @@ sub htmlVoteStats { what => $type eq 'v' ? 'user' : 'vn', hide => $type eq 'v', ); - table class => 'recentvotes'; - thead; Tr; - td colspan => 3, 'Recent votes'; - end; end; - for (0..$#$recent) { - Tr $_ % 2 == 0 ? (class => 'odd') : (); - td; - if($type eq 'u') { - a href => "/v$recent->[$_]{vid}", title => $recent->[$_]{original}||$recent->[$_]{title}, shorten $recent->[$_]{title}, 40; - } else { - a href => "/u$recent->[$_]{uid}", $recent->[$_]{username}; - } - end; - td $recent->[$_]{vote}; - td date $recent->[$_]{date}; - end; - } - end; + if(@$recent) { + table class => 'recentvotes'; + thead; Tr; + td colspan => 3, 'Recent votes'; + end; end; + for (0..$#$recent) { + Tr $_ % 2 == 0 ? (class => 'odd') : (); + td; + if($type eq 'u') { + a href => "/v$recent->[$_]{vid}", title => $recent->[$_]{original}||$recent->[$_]{title}, shorten $recent->[$_]{title}, 40; + } else { + a href => "/u$recent->[$_]{uid}", $recent->[$_]{username}; + } + end; + td $recent->[$_]{vote}; + td date $recent->[$_]{date}; + end; + } + end; + } clearfloat; end; } |