summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-03-21 13:50:21 +0100
committerYorhel <git@yorhel.nl>2009-03-21 13:54:22 +0100
commitfac70af55b0f6af8152209760d4f32affa525deb (patch)
tree316ea8c312d93a79d03b56b938c0b5bcdfbad2dd
parentcbfb086feab8d06e8184f7b8d809780404d091bf (diff)
Partly removed the category system
The categories are still available for viewing and editing to aid in the transition to the tagging system, but editing has been removed.
-rw-r--r--data/docs/14
-rw-r--r--data/docs/213
-rw-r--r--data/style.css4
-rw-r--r--lib/VNDB/Handler/VNEdit.pm30
-rw-r--r--lib/VNDB/Handler/VNPage.pm6
-rw-r--r--static/f/forms.js51
-rw-r--r--static/f/script.js2
7 files changed, 15 insertions, 95 deletions
diff --git a/data/docs/1 b/data/docs/1
index 835d2070..c6d7914c 100644
--- a/data/docs/1
+++ b/data/docs/1
@@ -1,4 +1,8 @@
:TITLE:Categories
+<div class="warning">
+ The category system has been replaced with a new tagging system. This page
+ is still available for reference, but will be removed in a later site update.
+</div>
:INC:index
diff --git a/data/docs/2 b/data/docs/2
index c6428c55..2f7095df 100644
--- a/data/docs/2
+++ b/data/docs/2
@@ -63,15 +63,10 @@
:SUB:Categories
-<p>
- It is possible to select relevant categories for visual novels, where the relevance
- can be ranked using a number from 0 to 3, where 0 indicates the category does not
- apply at all, and 3 means that the category is very dominant in the game.<br />
- See <a href="/d1">Categories</a> for descriptions about each category.<br />
- Just as with the <i>Length</i> field, this information is very subjective. Just
- use the category descriptions and common sense to determine which categories to
- select and what relevance to apply.
-</p>
+<i>
+ The category system has been replaced with tags. This section is a placeholder to preserve
+ numbering.
+</i>
:SUB:Image
diff --git a/data/style.css b/data/style.css
index e5a78d92..679ca282 100644
--- a/data/style.css
+++ b/data/style.css
@@ -578,12 +578,12 @@ div.vndetails table dt {
div.vndetails table dd {
margin-left: 90px;
}
-/*
+
.catlvl_0, .catlvl_1, .catlvl_2, .catlvl_3 { font-style: normal; }
.catlvl_1 { color: $catlevel1$!important }
.catlvl_2 { color: $catlevel2$!important }
.catlvl_3 { color: $catlevel3$!important }
-*/
+
div.vndetails td.relations dt {
float: none;
font-style: normal;
diff --git a/lib/VNDB/Handler/VNEdit.pm b/lib/VNDB/Handler/VNEdit.pm
index 6790ae6e..8363b500 100644
--- a/lib/VNDB/Handler/VNEdit.pm
+++ b/lib/VNDB/Handler/VNEdit.pm
@@ -27,7 +27,6 @@ sub edit {
my %b4 = !$vid ? () : (
(map { $_ => $v->{$_} } qw|title original desc alias length l_wp l_encubed l_renai l_vnn img_nsfw|),
anime => join(' ', sort { $a <=> $b } map $_->{id}, @{$v->{anime}}),
- categories => join(',', map $_->[0].$_->[1], sort { $a->[0] cmp $b->[0] } @{$v->{categories}}),
relations => join('|||', map $_->{relation}.','.$_->{id}.','.$_->{title}, sort { $a->{id} <=> $b->{id} } @{$v->{relations}}),
screenshots => join(' ', map sprintf('%d,%d,%d', $_->{id}, $_->{nsfw}?1:0, $_->{rid}), @{$v->{screenshots}}),
);
@@ -45,7 +44,6 @@ sub edit {
{ name => 'l_renai', required => 0, default => '', maxlength => 100 },
{ name => 'l_vnn', required => 0, default => 0, template => 'int' },
{ name => 'anime', required => 0, default => '' },
- { name => 'categories', required => 0, default => '', maxlength => 1000 },
{ name => 'img_nsfw', required => 0, default => 0 },
{ name => 'relations', required => 0, default => '', maxlength => 5000 },
{ name => 'screenshots', required => 0, default => '', maxlength => 1000 },
@@ -58,7 +56,6 @@ sub edit {
if(!$frm->{_err}) {
# parse and re-sort fields that have multiple representations of the same information
my $anime = [ grep /^[0-9]+$/, split /[ ,]+/, $frm->{anime} ];
- my $categories = [ map { [ substr($_,0,3), substr($_,3,1) ] } split /,/, $frm->{categories} ];
my $relations = [ map { /^([0-9]+),([0-9]+),(.+)$/ && (!$vid || $2 != $vid) ? [ $1, $2, $3 ] : () } split /\|\|\|/, $frm->{relations} ];
my $screenshots = [ map /^[0-9]+,[01],[0-9]+$/ ? [split /,/] : (), split / +/, $frm->{screenshots} ];
@@ -75,7 +72,7 @@ sub edit {
my %args = (
(map { $_ => $frm->{$_} } qw|title original alias desc length l_wp l_encubed l_renai l_vnn editsum img_nsfw|),
anime => $anime,
- categories => $categories,
+ categories => $v->{categories},
relations => $relations,
image => $image,
screenshots => $screenshots,
@@ -181,31 +178,6 @@ sub _form {
|],
],
- 'Categories' => [
- [ hidden => short => 'categories' ],
- [ static => nolabel => 1, content => sub {
- lit 'Please read the <a href="/d1">category descriptions</a> before modifying categories!<br /><br />';
- ul;
- for my $c (qw| e g t p h l s |) {
- $c !~ /[thl]/ ? li : br;
- txt $self->{categories}{$c}[0];
- a href => "/d1#$self->{categories}{$c}[2]", class => 'help', '?';
- ul;
- for (sort keys %{$self->{categories}{$c}[1]}) {
- li;
- a href => "#", id => "cat_$c$_";
- b id => "b_$c$_", '-';
- txt ' '.$self->{categories}{$c}[1]{$_};
- end;
- end;
- }
- end;
- end if $c !~ /[gph]/;
- }
- end;
- }],
- ],
-
'Image' => [
[ static => nolabel => 1, content => sub {
div class => 'img';
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index da8fe570..56fcc70d 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -120,7 +120,7 @@ sub page {
}
_producers($self, \$i, $r);
- #_categories($self, \$i, $v) if @{$v->{categories}};
+ _categories($self, \$i, $v) if @{$v->{categories}};
_relations($self, \$i, $v) if @{$v->{relations}};
_anime($self, \$i, $v) if @{$v->{anime}};
_useroptions($self, \$i, $v) if $self->authInfo->{id};
@@ -272,7 +272,8 @@ sub _categories {
Tr ++$$i % 2 ? (class => 'odd') : ();
td 'Categories';
td;
- dl;
+ dl id => 'vncats', style => 'display: none';
+ dt 'Note:'; dd "The category system is outdated, please use tags instead.\n\n";
for (@cat) {
dt shift(@$_).':';
dd;
@@ -280,6 +281,7 @@ sub _categories {
end;
}
end;
+ a href => '#', onclick => "document.getElementById('vncats').style.display='';this.style.display='none';return false", 'Show categories';
end;
end;
}
diff --git a/static/f/forms.js b/static/f/forms.js
index e104b7e3..193b36d8 100644
--- a/static/f/forms.js
+++ b/static/f/forms.js
@@ -11,57 +11,6 @@ function shorten(v, l) {
- /************************\
- * C A T E G O R I E S *
- \************************/
-
-
-function catLoad() {
- var i;
- var cats=[];
- var ct = x('categories');
- var l = ct.value.split(',');
- for(i=0;i<l.length;i++)
- cats[l[i].substr(0,3)] = Math.floor(l[i].substr(3,1));
-
- l = x('jt_box_categories').getElementsByTagName('a');
- for(i=0;i<l.length;i++) {
- if(l[i].id.substr(0, 4) != 'cat_')
- continue;
- catSet(l[i].id.substr(4), cats[l[i].id.substr(4)]||0);
- 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' || c.substr(0,1) == 'l' || c.substr(0,1) == 't') {
- if(cats[c]++)
- cats[c] = 0;
- } else if(++cats[c] == 4)
- cats[c] = 0;
- catSet(c, cats[c]);
-
- // has to be ordered before serializing!
- var r;l=[];i=0;
- for(r in cats)
- l[i++] = r;
- l = l.sort();
- r='';
- for(i=0;i<l.length;i++)
- if(cats[l[i]] > 0)
- r+=(r?',':'')+l[i]+cats[l[i]];
- ct.value = r;
- return false;
- };
- }
-}
-
-function catSet(id, rnk) {
- x('cat_'+id).className = 'catlvl_'+rnk;
- x('b_'+id).innerHTML = rnk;
-}
-
-
-
-
/***********************************\
diff --git a/static/f/script.js b/static/f/script.js
index fa92382d..bdb2cd14 100644
--- a/static/f/script.js
+++ b/static/f/script.js
@@ -516,8 +516,6 @@ DOMLoad(function() {
}
// forms.js
- if(x('categories'))
- catLoad();
if(x('relations'))
relLoad();
if(x('jt_box_screenshots'))