diff options
Diffstat (limited to 'data/tpl/vnpage_stats')
-rw-r--r-- | data/tpl/vnpage_stats | 13 |
1 files changed, 5 insertions, 8 deletions
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"> |