summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-07-08 07:51:50 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-07-08 07:51:50 +0000
commit079e594bb5a43f948fed01b5140e01f3fd127ff9 (patch)
tree5d4b0756a03e49b36cd0f2ba44c46a1b0d60980f /data
parentdb47e11b580efa1938de892e6c08ba47ba2c6cc4 (diff)
Removed the rating system and small cleanup on the homepage
git-svn-id: svn://vndb.org/vndb@55 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'data')
-rw-r--r--data/tpl/home25
-rw-r--r--data/tpl/vnbrowse3
-rw-r--r--data/tpl/vnpage4
-rw-r--r--data/tpl/vnpage_stats14
4 files changed, 10 insertions, 36 deletions
diff --git a/data/tpl/home b/data/tpl/home
index 5ea730ce..b07e6e11 100644
--- a/data/tpl/home
+++ b/data/tpl/home
@@ -14,7 +14,7 @@
</p>
<h3 class="home">[[: $d{an}{title} ]]-
- <p class="actions">by <a href="/u[[= $d{anpost}{uid} ]]">[[: $d{anpost}{username} ]]</a>, -[[= age $d{anpost}{date} ]]</p></h3>
+ <p class="actions">[[= age $d{anpost}{date} ]]</p></h3>
<p class="desc">
[[= summary $d{anpost}{msg}, 200 ]]
<br />
@@ -29,20 +29,6 @@
</ul>
<ul class="home">
- <li><b>Recent votes</b></li>
- [[ for (@{$d{recentvotes}}) { ]]-
- <li><a href="/v[[= $_->{vid} ]]" title="[[: $_->{title} ]]">[[: shorten $_->{title}, 30 ]]</a> ([[= $_->{vote} ]])</li>
- [[ } ]]
-</ul>
-
-<ul class="home">
- <li><b>Most popular</b></li>
- [[ for (@{$d{popular}}) { $_->{c_votes} =~ s#^([0-9]{2}.[0-9]{2}).+$#sprintf '%.1f', $1#e; ]]-
- <li><a href="/v[[= $_->{id} ]]" title="[[: $_->{title} ]]">[[: shorten $_->{title}, 30 ]]</a> ([[= $_->{c_votes} ]])</li>
- [[ } ]]
-</ul>
-
-<ul class="home break">
<li><b>Recently added visual novels</b></li>
[[ for (@{$d{recentvns}}) { ]]-
<li><a href="/v[[= $_->{iid} ]]" title="[[: $_->{ititle} ]]">[[: shorten $_->{ititle}, 30 ]]</a></li>
@@ -55,12 +41,3 @@
<li><a href="/p[[= $_->{iid} ]]" title="[[: $_->{ititle} ]]">[[: shorten $_->{ititle}, 30 ]]</a></li>
[[ } ]]-
</ul>
-
-<ul class="home">
- <li><b>Random visual novels</b></li>
- [[ for (@{$d{randomvns}}) { ]]-
- <li><a href="/v[[= $_->{id} ]]" title="[[: $_->{title} ]]">[[: shorten $_->{title}, 30 ]]</a></li>
- [[ } ]]-
-</ul>
-
-
diff --git a/data/tpl/vnbrowse b/data/tpl/vnbrowse
index 42514bcd..f03d74d1 100644
--- a/data/tpl/vnbrowse
+++ b/data/tpl/vnbrowse
@@ -88,10 +88,8 @@
<td class="tc2">&nbsp;</td>
<td class="tc3">&nbsp;</td>
<td class="tc4">Released [[= sortbut($url, 'released') ]]</td>
- <td class="tc5">Rating [[= sortbut($url, 'votes') ]]</td>
</tr></thead>
[[ for (@{$d{vn}}) {
- $_->{c_votes} =~ s#^([0-9]{2}.[0-9]{2})\|([0-9]{4})$#$1 == 0 ? sprintf '- (%d)', $2 : sprintf '%.2f (%d)', $1, $2#e;
$_->{c_released} =~ s#^([0-9]{4})([0-9]{2}).+#$1==0?'N/A':$1==9999?'TBA':(($2&&$2<13?($Time::CTime::MoY[$2-1].' '):'').$1)#e;
$_->{c_platforms} = join '', map {
$_ ne 'oth' ? '<acronym class="icons '.$_.'" title="'._hchar($VNDB::PLAT->{$_}).'">&nbsp;</acronym>' : ()
@@ -103,7 +101,6 @@
<td class="tc2">[[= $_->{c_platforms} ]]</td>
<td class="tc3">[[= $_->{c_languages} ]]</td>
<td class="tc4">[[: $_->{c_released} ]]</td>
- <td class="tc5">[[: $_->{c_votes} ]]</td>
</tr>
[[ } ]]-
</table>
diff --git a/data/tpl/vnpage b/data/tpl/vnpage
index 551731a5..19061249 100644
--- a/data/tpl/vnpage
+++ b/data/tpl/vnpage
@@ -65,9 +65,6 @@
</div>
-[[
- $d{vn}{c_votes} =~ s#^([0-9]{2}.[0-9]{2})\|([0-9]{4})$#$2 == 0 ? 'No votes yet' :
- $1 == 0 ? sprintf 'N/A (%d vote%s)', $2, $2>1?'s':'' : sprintf '%.2f (%d vote%s)', $1, $2, $2>1?'s':''#e;
-
my @links = (
$d{vn}{l_wp} ? [ 'Wikipedia', 'http://en.wikipedia.org/wiki/%s', $d{vn}{l_wp} ] : (),
$d{vn}{l_encubed} ? [ 'Encubed', 'http://novelnews.net/tag/%s/', _huri $d{vn}{l_encubed} ] : (),
@@ -86,7 +83,6 @@ if($d{vn}{length} || $d{vn}{alias} || @links || $prod) { ]]
<dt>Aliases</dt><dd>[[: $d{vn}{alias} ]]</dd>[[ } ]]-
[[ if(@links > 0) { ]]-
<dt>Links</dt><dd>[[= join(', ', map { '<a href="'.sprintf($_->[1],$_->[2]).'">'.$_->[0].'</a>' } @links) ]]</dd>[[ } ]]-
- <dt>Rating</dt><dd>[[: $d{vn}{c_votes} ]]</dd>
[[ if($prod) { ]]-
<dt>Producers</dt><dd>
[[ for my $l (@lang) { my %l;
diff --git a/data/tpl/vnpage_stats b/data/tpl/vnpage_stats
index 7108486e..d5d002a7 100644
--- a/data/tpl/vnpage_stats
+++ b/data/tpl/vnpage_stats
@@ -1,13 +1,17 @@
<ul id="stats">
+
[[
my $max = 1; my $total = 0; my $sum = 0;
- 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}) {
+ 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{user} || ($d{pv} && $d{user}{votes})) { ]]-
+[[ if($d{votes}{graph} && $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">