summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-07-13 11:35:46 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-07-13 11:35:46 +0000
commit444f1107fd8bb195324c960c384875ab2e0bbc12 (patch)
tree73de868cb75951fd4ee3941d67cc2b9676199ebe /data
parenta9de16e13ba4b2270794e2b1aef4f710fa143cbf (diff)
Re-added the vote stats to VN pages, Searching for 'Chinese' doesn't select 'NES' and Place/time category order on VN pages is now consistent
git-svn-id: svn://vndb.org/vndb@66 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'data')
-rw-r--r--data/tpl/vnpage3
-rw-r--r--data/tpl/vnpage_stats13
2 files changed, 7 insertions, 9 deletions
diff --git a/data/tpl/vnpage b/data/tpl/vnpage
index 19061249..123a3147 100644
--- a/data/tpl/vnpage
+++ b/data/tpl/vnpage
@@ -111,7 +111,8 @@ if($d{vn}{length} || $d{vn}{alias} || @links || $prod) { ]]
<dt>[[: $VNDB::CAT->{$c}[0] ]]</dt><dd>[[= join(', ', @c) ]]</dd>
[[ } } ]]
[[ if(grep $_->[0] =~ /^[tl]/, @{$d{vn}{categories}}) { ]]-
- <dt>Place/Time</dt><dd>[[= join ', ', map $VNDB::CAT->{substr($_->[0],0,1)}[1]{substr($_->[0],1,2)}, sort grep $_->[0] =~ /^[tl]/, @{$d{vn}{categories}} ]]</dd>
+ <dt>Place/Time</dt><dd>[[= join ', ', map $VNDB::CAT->{substr($_->[0],0,1)}[1]{substr($_->[0],1,2)},
+ sort { $a->[0] cmp $b->[0] } grep $_->[0] =~ /^[tl]/, @{$d{vn}{categories}} ]]</dd>
[[ } ]]-
</dl>
[[ } ]]-
diff --git a/data/tpl/vnpage_stats b/data/tpl/vnpage_stats
index d5d002a7..841fce37 100644
--- a/data/tpl/vnpage_stats
+++ b/data/tpl/vnpage_stats
@@ -2,16 +2,13 @@
[[
my $max = 1; my $total = 0; my $sum = 0;
-
- if($d{votes}{graph}) {
- for (0..$#{$d{votes}{graph}}) {
- $total += $d{votes}{graph}[$_];
- $max = $d{votes}{graph}[$_] if $d{votes}{graph}[$_] > $max;
- $sum += ($_+1) * $d{votes}{graph}[$_];
- }
+ for (0..$#{$d{votes}{graph}}) {
+ $total += $d{votes}{graph}[$_];
+ $max = $d{votes}{graph}[$_] if $d{votes}{graph}[$_] > $max;
+ $sum += ($_+1) * $d{votes}{graph}[$_];
}
]]
-[[ if($d{votes}{graph} && $d{pv} && $d{user}{votes}) { ]]-
+[[ if(!$d{user} || ($d{pv} && $d{user}{votes})) { ]]-
<li><h3>Vote graph <p class="actions">[[= $total ]]- vote[[= $total==1?'':'s' ]]- total
[[= $total ? sprintf(', average: %.1f.', $sum/$total) : '' ]]</p></h3>
<table id="tvg">