summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2008-11-12 14:46:42 +0100
committerYorhel <git@yorhel.nl>2008-11-12 14:46:42 +0100
commit727714378e8eb8a8c1ebd8a4b7d69df0148a1e4e (patch)
treef409cdee87a24fae87ad95cf70a9d57b3645d0c8
parent55639ecf1be3a69f77f836daa1cc017ad6e8d4b1 (diff)
Expanded producer page with VN info and created a nice page layout
-rw-r--r--data/global.pl29
-rw-r--r--lib/VNDB/DB/Producers.pm22
-rw-r--r--lib/VNDB/Handler/Producers.pm30
-rw-r--r--static/f/style.css19
4 files changed, 96 insertions, 4 deletions
diff --git a/data/global.pl b/data/global.pl
index e6702d6f..3889628a 100644
--- a/data/global.pl
+++ b/data/global.pl
@@ -19,6 +19,7 @@ our %S = (
url_static => 'http://s.vndb.org',
cookie_domain => '.vndb.org',
cookie_key => 'any-private-string-here',
+ sharedmem_key => 'VNDB',
user_ranks => [
# rankname allowed actions # DB number
[qw| visitor hist |], # 0
@@ -27,7 +28,31 @@ our %S = (
[qw| mod hist board boardmod edit mod lock del |], # 3
[qw| admin hist board boardmod edit mod lock del usermod |], # 4
],
- sharedmem_key => 'VNDB',
+ languages => {
+ cs => q|Czech|,
+ da => q|Danish|,
+ de => q|German|,
+ en => q|English|,
+ es => q|Spanish|,
+ fi => q|Finnish|,
+ fr => q|French|,
+ it => q|Italian|,
+ ja => q|Japanese|,
+ ko => q|Korean|,
+ nl => q|Dutch|,
+ no => q|Norwegian|,
+ pl => q|Polish|,
+ pt => q|Portuguese|,
+ ru => q|Russian|,
+ sv => q|Swedish|,
+ tr => q|Turkish|,
+ zh => q|Chinese|,
+ },
+ producer_types => {
+ co => 'Company',
+ in => 'Individual',
+ ng => 'Amateur group',
+ },
);
@@ -50,3 +75,5 @@ our %M = (
require $ROOT.'/data/config.pl' if -f $ROOT.'/data/config.pl';
1;
+
+
diff --git a/lib/VNDB/DB/Producers.pm b/lib/VNDB/DB/Producers.pm
index fda367f5..d8a46774 100644
--- a/lib/VNDB/DB/Producers.pm
+++ b/lib/VNDB/DB/Producers.pm
@@ -53,7 +53,27 @@ sub dbProducerGet {
$select, join(' ', @join), \%where,
);
- # TODO: get vn
+ if(@$r && $o{what} =~ /vn/) {
+ my %r = map {
+ $r->[$_]{vn} = [];
+ ($r->[$_]{id}, $_)
+ } 0..$#$r;
+
+ push @{$r->[$r{$_->{pid}}]{vn}}, $_ for (@{$self->dbAll(q|
+ SELECT MAX(vp.pid) AS pid, v.id, MAX(vr.title) AS title, MAX(vr.original) AS original, MIN(rr.released) AS date
+ FROM releases_producers vp
+ JOIN releases_rev rr ON rr.id = vp.rid
+ JOIN releases r ON r.latest = rr.id
+ JOIN releases_vn rv ON rv.rid = rr.id
+ JOIN vn v ON v.id = rv.vid
+ JOIN vn_rev vr ON vr.id = v.latest
+ WHERE vp.pid IN(!l)
+ AND v.hidden = FALSE
+ GROUP BY v.id
+ ORDER BY date|,
+ [ keys %r ]
+ )});
+ }
return wantarray ? ($r, $np) : $r;
}
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index 0ec582c5..2583ad13 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -14,14 +14,40 @@ YAWF::register(
sub page {
my($self, $pid) = @_;
- my $p = $self->dbProducerGet(id => $pid)->[0];
+ my $p = $self->dbProducerGet(id => $pid, what => 'vn')->[0];
return 404 if !$p->{id};
$self->htmlHeader(title => $p->{name});
$self->htmlMainTabs(p => $p);
- div class => 'mainbox';
+ div class => 'mainbox producerpage';
h1 $p->{name};
h2 class => 'alttitle', $p->{original} if $p->{original};
+ p class => 'center';
+ txt "$self->{languages}{$p->{lang}} \L$self->{producer_types}{$p->{type}}";
+ if($p->{website}) {
+ txt "\n";
+ a href => $p->{website}, $p->{website};
+ }
+ end;
+
+ p class => 'description', $p->{desc}
+ if $p->{desc};
+
+ end;
+ div class => 'mainbox producerpage';
+ h1 'Visual Novel Relations';
+ if(!@{$p->{vn}}) {
+ p 'We have currently no visual novels related to this producer.';
+ } else {
+ ul;
+ for (@{$p->{vn}}) {
+ li;
+ txt "$_->{date} ";
+ a href => "/v$_->{id}", title => $_->{original}, $_->{title};
+ end;
+ }
+ end;
+ }
end;
$self->htmlFooter;
}
diff --git a/static/f/style.css b/static/f/style.css
index d492a4a2..52701306 100644
--- a/static/f/style.css
+++ b/static/f/style.css
@@ -336,6 +336,25 @@ div.vndescription p {
+/***** Producer page *******/
+
+.producerpage p.description {
+ margin: 10px 100px!important;
+}
+.producerpage ul {
+ margin: 0 50px;
+}
+.producerpage li {
+ padding-top: 3px;
+ list-style-type: none;
+}
+.producerpage li a {
+ margin-left: 10px;
+}
+
+
+
+
/***** Warning/Notice Box *****/
div.warning, div.notice {