summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-06-21 12:49:51 +0000
committeryorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b>2008-06-21 12:49:51 +0000
commit43adf6c1681cf62f2cfbfa90d75053a1d7da5d23 (patch)
tree0b663579038bfb1a702d939a4048008e0a0fd17c
parent5fae2ac0d0a85712bcf0611c99c5f7cf39421dc5 (diff)
Time and Place categories are now boolean, and small vnpage cleanup
git-svn-id: svn://vndb.org/vndb@32 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
-rw-r--r--data/tpl/vnpage26
-rw-r--r--lib/ChangeLog1
-rw-r--r--lib/global.pl6
-rw-r--r--static/files/dyna.js2
-rw-r--r--static/files/style.css2
-rw-r--r--util/updates/update_1.17.sql7
6 files changed, 28 insertions, 16 deletions
diff --git a/data/tpl/vnpage b/data/tpl/vnpage
index f6f12225..026f347f 100644
--- a/data/tpl/vnpage
+++ b/data/tpl/vnpage
@@ -1,6 +1,15 @@
[[= ttabs('v', $d{vn}) ]]
+
<h2>[[: $d{vn}{title} ]]</h2>
+-[[ 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>
+&gt;</p>
+[[ } ]]-
+
+
[[ if($d{vn}{hidden}) { ]]-
<span class="warning">
This item has been deleted from the database. File a request on the
@@ -55,14 +64,6 @@
[[ } ]]-
</div>
-
--[[ 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>
-&gt;</p>
-[[ } ]]-
-
-[[
$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;
@@ -100,10 +101,10 @@ if($d{vn}{length} || $d{vn}{alias} || @links || $prod) { ]]
</dl>
[[ } ]]-
- [[ if(@{$d{vn}{categories}}) { my %nolvl = (map {$_=>1} qw| pli pbr gaa gab hfa hfe |); ]]-
+ [[ if(@{$d{vn}{categories}}) { my %nolvl = (map {$_=>1} qw| pli pbr gaa gab hfa hfe lea lfa lsp tfu tpa tpr |); ]]-
<h3>Categories</h3>
- <dl>
- [[ for (sort keys %$VNDB::CAT) {
+ <dl class="vnrel">
+ [[ for (qw|e s g p h|) {
my $c = $_;
my @c = map { my $s=$_;
my ($cs) = grep { $_->[0] eq $c.$s } @{$d{vn}{categories}};
@@ -113,6 +114,9 @@ if($d{vn}{length} || $d{vn}{alias} || @links || $prod) { ]]
if(@c) { ]]-
<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>
+ [[ } ]]-
</dl>
[[ } ]]-
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 62785e5c..cadb5a32 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -18,6 +18,7 @@ TODO:
file to override all options - not available on SVN
- Dynamic loading, several bugfixes, and code cleanup for Multi
- Added 'School Life' and 'Protagonist' categories
+ - Time and Place categories are now boolean
- Added GTIN field to releases
- Added links to encubed and renai.us
diff --git a/lib/global.pl b/lib/global.pl
index 20e9f005..8ce803d3 100644
--- a/lib/global.pl
+++ b/lib/global.pl
@@ -118,17 +118,17 @@ our $CAT = {
sj => 'Shoujo Ai',
sn => 'Shounen Ai',
} ],
- t => [ 'Time', {
+ t => [ 'Time', { # 0..1
fu => 'Future',
pa => 'Past',
pr => 'Present',
} ],
- l => [ 'Place', {
+ l => [ 'Place', { # 0..1
ea => 'Earth',
fa => "Fant\x{200B}asy world",
sp => 'Space',
} ],
- h => [ 'Protagonist', { # 0..1
+ h => [ 'Protagonist', { # 0..1
fa => 'Male',
fe => "Fem\x{200B}ale",
} ],
diff --git a/static/files/dyna.js b/static/files/dyna.js
index 655269af..6a6b169a 100644
--- a/static/files/dyna.js
+++ b/static/files/dyna.js
@@ -545,7 +545,7 @@ function catLoad() {
l[i].onclick = function() {
var c = this.id.substr(4);
if(!cats[c]) cats[c] = 0;
- if(c.substr(0,1) == 'p' || c == 'gaa' || c == 'gab' || c.substr(0,1) == 'h') {
+ if(c.substr(0,1) == 'p' || c == 'gaa' || c == 'gab' || c.substr(0,1) == 'h' || c.substr(0,1) == 'l' || c.substr(0,1) == 't') {
if(cats[c]++)
cats[c] = 0;
} else if(++cats[c] == 4)
diff --git a/static/files/style.css b/static/files/style.css
index 8f503ed5..8b264c73 100644
--- a/static/files/style.css
+++ b/static/files/style.css
@@ -403,7 +403,7 @@ p.actions {
}
#vnheader li { list-style-type: none; margin: 0; padding: 0; }
#vnheader h3 {
- margin: 5px 0 0 260px;
+ margin: 10px 0 0 260px;
font-size: 13px;
}
#vnheader p.mod {
diff --git a/util/updates/update_1.17.sql b/util/updates/update_1.17.sql
index bba26069..c38d2e65 100644
--- a/util/updates/update_1.17.sql
+++ b/util/updates/update_1.17.sql
@@ -8,3 +8,10 @@ ALTER TABLE vn_rev DROP COLUMN l_cisv;
ALTER TABLE vn_rev ADD COLUMN l_encubed varchar(100) NOT NULL DEFAULT '';
ALTER TABLE vn_rev ADD COLUMN l_renai varchar(100) NOT NULL DEFAULT '';
+
+-- time and place categories have only one level now
+UPDATE vn_categories
+ SET lvl = 1
+ WHERE cat IN('tfu', 'tpa', 'tpr', 'lea', 'lfa', 'lsp');
+-- AND vid IN(SELECT latest FROM vn);
+