summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-07-29 11:15:07 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-07-29 11:15:07 +0000
commit7aea19c2f8e71a7d630b613a57325c4dce1b1363 (patch)
treeb4c2e35d40afc7b3a0a22eb8f509c49b37f5f7db /data
parenta0f440de277653b3c79fd117d026855ec6b78373 (diff)
- Added release list feature
- Added noindex tag to iid-ttag browser - Replaced last poster with age of last post on home page - Merged user vote lists into new vnlist - Removed 'hide votes' feature - Fixed users+1 stats bug - Fixed FF3 JS hack - Old VNList code is still present, need to decide what to do with that git-svn-id: svn://vndb.org/vndb@74 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'data')
-rw-r--r--data/tpl/defs.pl25
-rw-r--r--data/tpl/main22
-rw-r--r--data/tpl/myvotes31
-rw-r--r--data/tpl/rpage9
-rw-r--r--data/tpl/useredit1
-rw-r--r--data/tpl/userlist8
-rw-r--r--data/tpl/userpage5
-rw-r--r--data/tpl/vnpage7
-rw-r--r--data/tpl/vnpage_rel9
-rw-r--r--data/tpl/vnpage_stats30
10 files changed, 58 insertions, 89 deletions
diff --git a/data/tpl/defs.pl b/data/tpl/defs.pl
index ef5b3a67..27d1443d 100644
--- a/data/tpl/defs.pl
+++ b/data/tpl/defs.pl
@@ -215,7 +215,6 @@ sub ttabs { # [vrpu], obj, sel
($s eq 'edit' ? 'edit' : '<a href="'.($p{Authedit}?'/%s/edit':'/u/register?n=1').'" '.($t eq 'v' || $t eq 'r' ? 'class="dropdown" rel="nofollow editDD"':'').'>edit</a>') : (),
$t eq 'u' ? (
- $o->{flags} & $VNDB::UFLAGS->{votes} ? ( $s eq 'vote' ? 'votes' : '<a href="/%s/votes">votes</a>', ) : (),
$o->{flags} & $VNDB::UFLAGS->{list} ? ( $s eq 'list' ? 'list' : '<a href="/%s/list">list</a>', ) : (),
) : (),
@@ -258,6 +257,26 @@ sub ttabs { # [vrpu], obj, sel
}
+# Uwaaaa~ ugly function!
+sub rlist_dd {
+ my $r = shift;
+ return
+ qq|<div class="dropdown rlistdd" id="rlistDD$$r{id}"><ul><li><b>Release status</b></li>|.
+ join('', map {
+ $r->{rlist} && $_ == $r->{rlist}{rstat} ? "<li><b>&nbsp;&nbsp;$$VNDB::RSTAT[$_]</b></li>"
+ : qq|<li><a href="/r$$r{id}/list?r=$_">&nbsp;&nbsp;$$VNDB::RSTAT[$_]</a></li>|
+ } 0..$#$VNDB::RSTAT).
+ qq|</ul><ul><li><b>Play status</b></li>|.
+ join('', map {
+ $r->{rlist} && $_ == $r->{rlist}{vstat} ? "<li><b>&nbsp;&nbsp;$$VNDB::VSTAT[$_]</b></li>"
+ : qq|<li><a href="/r$$r{id}/list?v=$_">&nbsp;&nbsp;$$VNDB::VSTAT[$_]</a></li>|
+ } 0..$#$VNDB::VSTAT).
+ qq|</ul><ul class="full">|.
+ ($r->{rlist} ? qq|<li class="center"><a href="/r$$r{id}/list?d=1">remove from my list</a></li>|
+ : qq|<li class="center"><b>not in your list</b></li>|).
+ qq|</ul></div>|;
+}
+
my %pagetitles = (
faq => 'Frequently Asked Questions',
@@ -275,12 +294,12 @@ my %pagetitles = (
tedit => sub {
return $p{tedit}{p} ? 'Edit post' :
$p{tedit}{t} ? 'Reply to thread' : 'Start a new thread' },
- myvotes => sub {
- return $p{myvotes}{user}{username} eq $p{AuthUsername} ? 'My votes' : ('Votes by '.$p{myvotes}{user}{username}); },
userpage => sub {
return 'User: '.$p{userpage}{user}{username} },
vnlist => sub {
return $p{vnlist}{user}{username} eq $p{AuthUsername} ? 'My visual novel list' : ($p{vnlist}{user}{username}.'\'s visual novel list'); },
+ rlist => sub {
+ return $p{rlist}{user}{username} eq $p{AuthUsername} ? 'My visual novel list' : ($p{rlist}{user}{username}.'\'s visual novel list'); },
useredit => sub {
return !$p{useredit}{adm} ? 'My account' : 'Edit '.$p{useredit}{form}{username}.'\'s account'; },
ppage => sub {
diff --git a/data/tpl/main b/data/tpl/main
index 799a1ee8..d0739537 100644
--- a/data/tpl/main
+++ b/data/tpl/main
@@ -14,12 +14,15 @@
<script src="[[: $p{st} ]]/files/dyna.js?[[= $VNDB::VERSION ]]" type="text/javascript"></script>
[[ } ]]-
<script src="[[: $p{st} ]]/files/def.js?[[= $VNDB::VERSION ]]" type="text/javascript"></script>
-[[ if($p{devshit}) { ]]-
+[[ if(0 && $p{devshit}) { ]]-
<link rel="icon" href="/favicon.gif" type="image/gif" />
<meta name="robots" content="noindex, nofollow" />
-[[ } elsif($p{userlist} || $p{userpage} || $p{userlogin} || $p{userreg} || $p{userpass} || $p{myvotes}
- || $p{vnlist} || $p{hist} || ($p{vnpage} && $p{vnpage}{page} eq 'stats')
- || grep { $p{$_} && $p{$_}{change} } qw|vnpage ppage rpage|) { ]]-
+[[ } elsif(
+ grep($p{$_}, qw| userlist userpage userlogin userreg userpass vnlist rlist hist |)
+ || ($p{ttag} && $p{ttag}{iid})
+ || ($p{vnpage} && $p{vnpage}{page} eq 'stats')
+ || grep { $p{$_} && $p{$_}{change} } qw|vnpage ppage rpage|
+ ) { ]]-
<meta name="robots" content="noindex, follow" />
[[ }]]-
@@ -61,13 +64,13 @@
[[ if($p{pbrowse}) { %d = %{$p{pbrowse}}; ]] [[+ pbrowse ]][[ } ]]
[[ if($p{pedit}) { %d = %{$p{pedit}}; ]] [[+ pedit ]][[ } ]]
[[ if($p{ppage}) { %d = %{$p{ppage}}; ]] [[+ ppage ]][[ } ]]
-[[ if($p{myvotes}) { %d = %{$p{myvotes}}; ]] [[+ myvotes ]][[ }# ]]
[[ if($p{vnlist}) { %d = %{$p{vnlist}}; ]] [[+ vnlist ]][[ }# ]]
+[[ if($p{rlist}) { %d = %{$p{rlist}}; ]] [[+ rlist ]][[ }# ]]
[[ if($p{hist}) { %d = %{$p{hist}}; ]] [[+ hist ]][[ }# ]]
[[ if($p{rpage}) { %d = %{$p{rpage}}; ]] [[+ rpage ]][[ } ]]
[[ if($p{docs}) { %d = %{$p{docs}}; ]] [[+ docs ]][[ } ]]
[[ if($p{tindex}) { %d = %{$p{tindex}}; ]] [[+ tindex ]][[ } ]]
-[[ if($p{ttag}) { %d = %{$p{ttag}}; ]] [[+ ttag ]][[ } ]]
+[[ if($p{ttag}) { %d = %{$p{ttag}}; ]] [[+ ttag ]][[ }# ]]
[[ if($p{tthread}) { %d = %{$p{tthread}}; ]] [[+ tthread ]][[ } ]]
[[ if($p{tedit}) { %d = %{$p{tedit}}; ]] [[+ tedit ]][[ } ]]
[[ if($p{error}) { %d = %{$p{error}}; ]] [[+ error ]][[ } ]]
@@ -103,12 +106,11 @@
[[ } else { ]]-
<h2>User menu</h2>
<ul>
- <li>[[: $p{AuthUsername} ]]- ([[: $p{AuthRankname} ]])</li>
- <li><a href="/u[[= $p{AuthId} ]]/edit">My profile</a></li>
- <li><a href="/u[[= $p{AuthId} ]]/votes">My votes</a></li>
+ <li><a href="/u[[= $p{AuthId} ]]">[[: $p{AuthUsername} ]]</a> ([[: $p{AuthRankname} ]])</li>
+ <!--<li><a href="/u[[= $p{AuthId} ]]/edit">My profile</a></li>-->
<li><a href="/u[[= $p{AuthId} ]]/list">My visual novel list</a></li>
- <li><a href="/u[[= $p{AuthId} ]]/hist">My recent changes</a></li>
<li><a href="/t/u[[= $p{AuthId} ]]">My messages</a></li>
+ <li><a href="/u[[= $p{AuthId} ]]/hist">My recent changes</a></li>
[[ if($p{Authedit}) { ]]-
<li>&nbsp;</li>
<li><a href="/v/new">Add visual novel</a></li>
diff --git a/data/tpl/myvotes b/data/tpl/myvotes
deleted file mode 100644
index 231eaf25..00000000
--- a/data/tpl/myvotes
+++ /dev/null
@@ -1,31 +0,0 @@
-[[= ttabs('u', $d{user}, 'vote') ]]
-<h2>[[: $p{PageTitle} ]]</h2>
-[[ if($#{$d{votes}} < 0) { ]]-
-<p>
-[[ if($d{user}{username} eq $p{AuthUsername}) { ]]
- You haven't voted on anything yet...
-[[ } else { ]]
- [[: $d{user}{username} ]]- hasn't voted on anything yet...
-[[ } ]]
-</p>
-[[ } else {
- my $url = sprintf '/u%d/votes', $d{user}{id};
- my $surl = sprintf '%s?s=%s&amp;o=%s', $url, $d{order}[0], $d{order}[1];
-]]
-[[= pagebut($surl) ]]-
-<table id="tmv">
- <thead><tr>
- <td class="tc1">Title [[= sortbut($url, 'title') ]]</td>
- <td class="tc2">Vote [[= sortbut($url, 'vote') ]]</td>
- <td class="tc3">Date [[= sortbut($url, 'date') ]]</td>
- </tr></thead>
- [[ for (@{$d{votes}}) { ]]-
- <tr>
- <td class="tc1"><a href="/v[[= $_->{vid} ]]">[[: $_->{title} ]]</a></td>
- <td class="tc2">[[: $_->{vote} ]]</td>
- <td class="tc3">[[= formatdate('%Y-%m-%d', $_->{date}, 'dh') ]]</td>
- </tr>
- [[ } ]]-
-</table>
--[[= pagebut($surl) ]]
-[[ } ]]
diff --git a/data/tpl/rpage b/data/tpl/rpage
index 54267204..1652ec47 100644
--- a/data/tpl/rpage
+++ b/data/tpl/rpage
@@ -9,9 +9,16 @@
[[ } ]]
[[ if(!$d{rel}{hidden} || $p{Authdel}) { ]]-
+-[[ if($p{AuthLoggedin}) { ]]
+<p class="mod">&lt;
+<a href="/u[[= $p{AuthId} ]]/list" rel="rlistDD[[= $d{rel}{id} ]]" class="dropdown">
+[[= !$d{rel}{rlist} ? 'not in your list' : "$$VNDB::RSTAT[$d{rel}{rlist}{rstat}] / $$VNDB::VSTAT[$d{rel}{rlist}{vstat}]" ]]
+</a> &gt;</p>
+[[= rlist_dd($d{rel}) ]]
+[[ } ]]-
-[[ if($d{change}) { ]]
+-[[ if($d{change}) { ]]
[[= cdiff($d{prev}, $d{rel},
[ vn => 'Relations', sub { join("<br />\n", map { $_->{title} } @{$_[0]}) } ],
[ type => 'Type', sub { $VNDB::RTYP->[$_[0] ] } ],
diff --git a/data/tpl/useredit b/data/tpl/useredit
index 0e152f80..f9db7c61 100644
--- a/data/tpl/useredit
+++ b/data/tpl/useredit
@@ -20,7 +20,6 @@
{ type => 'pass', name => 'Confirm', short => 'pass2' },
{ type => 'sub', title => 'Miscellaneous options', short => 'misc' },
- { type => 'check', short => 'pvotes', name => sprintf 'Allow other people to see my votes (<a href="/u%d/votes">/u%1$d/votes</a>)', $d{user} },
{ type => 'check', short => 'plist', name => sprintf 'Allow other people to see my visual novel list (<a href="/u%d/list">/u%1$d/list</a>)', $d{user} },
{ type => 'check', short => 'pign_nsfw', name => 'Disable warnings for images that are not safe for work.' },
diff --git a/data/tpl/userlist b/data/tpl/userlist
index d83249e1..578d320e 100644
--- a/data/tpl/userlist
+++ b/data/tpl/userlist
@@ -23,7 +23,6 @@
<td class="tc2">Mail [[= sortbut($url, 'mail') ]]</td>
<td class="tc3">Rank [[= sortbut($url, 'rank') ]]</td>[[ } ]]-
<td class="tc4">Registered [[= sortbut($url, 'registered') ]]</td>
- <td class="tc5">VN list</td>
<td class="tc6">Votes</td>
<td class="tc7">Changes</td>
[[ if($p{Authusermod}) { ]]-
@@ -36,12 +35,9 @@
<td class="tc2">[[: $_->{mail} ]]</td>
<td class="tc3">[[: $VNDB::VNDBopts{ranks}[0][0][$_->{rank}] ]]</td>[[ } ]]-
<td class="tc4">[[= formatdate('%Y-%m-%d', $_->{registered}, 'wd') ]]</td>
- <td class="tc5">[[ if($_->{flags} & $VNDB::UFLAGS->{list} && $_->{vnlist}) { ]]
- <a href="/u[[= $_->{id} ]]/list" title="[[: $_->{username} ]]'s visual novel list">[[= $_->{vnlist} ]]</a>
+ <td class="tc6">[[ if($_->{flags} & $VNDB::UFLAGS->{list} && $_->{votes}) { ]]
+ <a href="/u[[= $_->{id} ]]/list" title="[[: $_->{username} ]]'s votes">[[= $_->{votes} ]]</a>
[[ } else { ]][[= $_->{flags} & $VNDB::UFLAGS->{list} ? 0 : '-' ]][[ } ]]</td>
- <td class="tc6">[[ if($_->{flags} & $VNDB::UFLAGS->{votes} && $_->{votes}) { ]]
- <a href="/u[[= $_->{id} ]]/votes" title="[[: $_->{username} ]]'s votes">[[= $_->{votes} ]]</a>
- [[ } else { ]][[= $_->{flags} & $VNDB::UFLAGS->{votes} ? 0 : '-' ]][[ } ]]</td>
<td class="tc7">[[ if($_->{changes}) { ]]
<a href="/u[[= $_->{id} ]]/hist" title="Recent changes by -[[: $_->{username} ]]">[[= $_->{changes} ]]</a>
[[ } else { ]]0[[ } ]]</td>
diff --git a/data/tpl/userpage b/data/tpl/userpage
index ef5fc55c..a45fc8af 100644
--- a/data/tpl/userpage
+++ b/data/tpl/userpage
@@ -1,13 +1,12 @@
[[= ttabs('u', $d{user}) ]]
[[
- ($d{pv}, $d{pl}) = ($d{user}{flags} & $VNDB::UFLAGS->{votes}, $d{user}{flags} & $VNDB::UFLAGS->{list});
+ $d{pl} = $d{user}{flags} & $VNDB::UFLAGS->{list};
]]
<h2>[[: $p{PageTitle} ]]</h2>
<dl>
<dt>Username</dt><dd>[[: $d{user}{username} ]]- (<a href="/u[[= $d{user}{id} ]]">u[[= $d{user}{id} ]]</a>)</dd>
<dt>Registered</dt><dd>[[= formatdate('%Y-%m-%d', $d{user}{registered}) ]]</dd>
- <dt>Votes</dt><dd>[[= $d{pv} ? $d{user}{votes}.' (<a href="/u'.$d{user}{id}.'/votes">view all</a>)' : '(hidden)' ]]</dd>
- <dt>VN List</dt><dd>[[= $d{pl} ? $d{user}{vnlist}.' (<a href="/u'.$d{user}{id}.'/list">view all</a>)' : '(hidden)' ]]</dd>
+ <dt>Votes</dt><dd>[[= $d{pl} ? $d{user}{list}.' (<a href="/u'.$d{user}{id}.'/list">view all</a>)' : '(hidden)' ]]</dd>
<dt>Changes</dt><dd>[[= $d{user}{changes}.($d{user}{changes}>0?' (<a href="/u'.$d{user}{id}.'/hist">recent changes</a>)':'') ]]</dd>
</dl>
diff --git a/data/tpl/vnpage b/data/tpl/vnpage
index 220b6c9f..f59c0a1c 100644
--- a/data/tpl/vnpage
+++ b/data/tpl/vnpage
@@ -12,9 +12,8 @@
[[ if(!$d{vn}{hidden} || $p{Authdel}) { ]]-
-[[ if($p{AuthLoggedin}) { ]]
-<p class="mod">&lt; user options -
- <a href="/u[[= $p{AuthId} ]]/votes" rel="voteDD" class="dropdown">[[= $d{vote}{vid} ? 'your vote: '.$d{vote}{vote} : 'vote' ]]</a>
-- <a href="/u[[= $p{AuthId} ]]/list" rel="listDD" class="dropdown">[[= !$d{list}{vid} ? 'add to vn list' : 'status: '.lc $VNDB::LSTAT->[$d{list}{status}] ]]</a>
+<p class="mod">&lt;
+ <a href="/u[[= $p{AuthId} ]]/list" rel="voteDD" class="dropdown">[[= $d{vote}{vid} ? 'your vote: '.$d{vote}{vote} : 'vote' ]]</a>
&gt;</p>
[[ } ]]-
@@ -179,6 +178,7 @@ if($d{vn}{length} || $d{vn}{alias} || @links || $prod) { ]]
</ul>
</div>
+[[ if(0) { ]]
<div class="dropdown" id="listDD">
<ul>
[[ for (0..$#$VNDB::LSTAT) { ]]-
@@ -188,6 +188,7 @@ if($d{vn}{length} || $d{vn}{alias} || @links || $prod) { ]]
[[ } ]]-
</ul>
</div>
+[[ } ]]
[[ } ]]
diff --git a/data/tpl/vnpage_rel b/data/tpl/vnpage_rel
index e213c12f..ed39477f 100644
--- a/data/tpl/vnpage_rel
+++ b/data/tpl/vnpage_rel
@@ -34,7 +34,10 @@
<acronym title="[[= $VNDB::RTYP->[$_->{type}] ]]- release" class="icons -[[= lc substr($VNDB::RTYP->[$_->{type}],0,3) ]]">&nbsp;</acronym>
</td>
<td class="tc4"><a href="/r[[= $_->{id} ]]" title="[[: $_->{original} || $_->{title} ]]">[[: shorten $_->{title},60 ]]</a></td>
- <td class="tc5">[[ if($_->{website}) { ]]<a href="[[: $_->{website} ]]" class="icons ext" title="WWW">&nbsp;</a>[[ } ]]</td>
+ <td class="tc5">[[ if($p{AuthId}) { ]]
+ [[= sprintf '<a href="/r%d/list?s=%d" class="dropdown above" rel="rlistDD%1$d">%s</a>', $_->{id}, $_->{rlist} ? (-1, 'x') : (1, '-') ]]
+ [[ } else { ]]&nbsp;[[ } ]]</td>
+ <td class="tc6">[[ if($_->{website}) { ]]<a href="[[: $_->{website} ]]" class="icons ext" title="WWW">&nbsp;</a>[[ } ]]</td>
</tr>
[[ } ]]-
[[ } ]]-
@@ -47,3 +50,7 @@
[[ } ]]
+[[ if($p{AuthId}) { ]]
+[[ for my $r (@{$d{rel}}) { ]]-
+-[[= rlist_dd($r) ]]
+[[ } } ]]
diff --git a/data/tpl/vnpage_stats b/data/tpl/vnpage_stats
index 653987a1..b4a3b018 100644
--- a/data/tpl/vnpage_stats
+++ b/data/tpl/vnpage_stats
@@ -36,34 +36,4 @@
[[ } ]]-
</table></li>
[[ } } ]]-
-
--[[ $max = 1; $total = 0;
- for (@{$d{lists}{graph}}) { $total += $_; $max = $_ if $_ > $max; } ]]
-[[ if(!$d{user} || ($d{pl} && $d{user}{vnlist})) { ]]-
-<li class="break"><h3>VN List stats <p class="actions">[[= $total ]]- -[[= $d{user}?'visual novel':'user' ]][[= $total==1?'':'s' ]]- total</p></h3>
-<table id="tus">
- [[ for (0..$#$VNDB::LSTAT) { ]]-
- <tr>
- <td class="tc1">[[= $VNDB::LSTAT->[$_] ]]</td>
- <td class="tc2"><div style="width: -[[= ($d{lists}{graph}[$_]/$max)*235 + 5 ]]px">&nbsp;</div>[[= $d{lists}{graph}[$_] ]]</td>
- </tr>
- [[ } ]]-
-</table></li>
-
-[[ if($#{$d{lists}{latest}} >= 0) { ]]
-<li><h3>Recent VN list additions</h3>
-<table id="tur">
-[[ for (@{$d{lists}{latest}}) { ]]-
- <tr>
- [[ if(!$d{user}) { ]]-
- <td class="tc1">[[= userstr $_ ]]</td>
- [[ } else { ]]-
- <td class="tc1"><a href="/v[[= $_->{vid} ]]">[[: length($_->{title})>25?substr($_->{title},0,23).'...':$_->{title} ]]</a></td>
- [[ } ]]-
- <td class="tc2">[[= $VNDB::LSTAT->[$_->{status}] ]]</td>
- <td class="tc3">[[= formatdate('%Y-%m-%d %R', $_->{date}, 'dh') ]]</td>
- </tr>
-[[ } ]]-
-</table></li>
-[[ } } ]]-
</ul>