summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-10 12:46:43 +0200
committerYorhel <git@yorhel.nl>2009-10-10 12:46:43 +0200
commit1e125f67ab50a5de477c538b3f7dd27a9ec3c62f (patch)
tree785cd10412c9b990e7e1c96d07d839743064ff1f /lib
parent4c4546ca2410844effb2edc72b80a3e1f8465f71 (diff)
Updated Producer and VN pages with developer/publisher information
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/DB/Producers.pm3
-rw-r--r--lib/VNDB/Handler/Producers.pm2
-rw-r--r--lib/VNDB/Handler/VNPage.pm45
3 files changed, 34 insertions, 16 deletions
diff --git a/lib/VNDB/DB/Producers.pm b/lib/VNDB/DB/Producers.pm
index 65d1fbca..18f372f9 100644
--- a/lib/VNDB/DB/Producers.pm
+++ b/lib/VNDB/DB/Producers.pm
@@ -61,7 +61,8 @@ sub dbProducerGet {
} 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
+ SELECT MAX(vp.pid) AS pid, v.id, MAX(vr.title) AS title, MAX(vr.original) AS original, MIN(rr.released) AS date,
+ MAX(CASE WHEN vp.developer = true THEN 1 ELSE 0 END) AS developer, MAX(CASE WHEN vp.publisher = true THEN 1 ELSE 0 END) AS publisher
FROM releases_producers vp
JOIN releases_rev rr ON rr.id = vp.rid
JOIN releases r ON r.latest = rr.id
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index e6477567..241ff00c 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -75,6 +75,8 @@ sub page {
lit $self->{l10n}->datestr($_->{date});
end;
a href => "/v$_->{id}", title => $_->{original}, $_->{title};
+ b class => 'grayedout', ' ('.join(', ',
+ $_->{developer} ? mt '_prodpage_dev' : (), $_->{publisher} ? mt '_prodpage_pub' : ()).')';
end;
}
end;
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index 16f80ef1..248d1d43 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -261,27 +261,42 @@ sub _revision {
sub _producers {
my($self, $i, $r) = @_;
- return if !grep @{$_->{producers}}, @$r;
my %lang;
my @lang = grep !$lang{$_}++, map @{$_->{languages}}, @$r;
- Tr ++$$i % 2 ? (class => 'odd') : ();
- td mt '_vnpage_producers';
- td;
- for my $l (@lang) {
- my %p = map { $_->{id} => $_ } map @{$_->{producers}}, grep grep($_ eq $l, @{$_->{languages}}), @$r;
- my @p = values %p;
- next if !@p;
- cssicon "lang $l", mt "_lang_$l";
- for (@p) {
+ if(grep $_->{developer}, map @{$_->{producers}}, @$r) {
+ my %dev = map $_->{developer} ? ($_->{id} => $_) : (), map @{$_->{producers}}, @$r;
+ my @dev = values %dev;
+ Tr ++$$i % 2 ? (class => 'odd') : ();
+ td mt "_vnpage_developer";
+ td;
+ for (@dev) {
a href => "/p$_->{id}", title => $_->{original}||$_->{name}, shorten $_->{name}, 30;
- txt ' & ' if $_ != $p[$#p];
+ txt ' & ' if $_ != $dev[$#dev];
}
- txt "\n";
- }
- end;
- end;
+ end;
+ end;
+ }
+
+ if(grep $_->{publisher}, map @{$_->{producers}}, @$r) {
+ Tr ++$$i % 2 ? (class => 'odd') : ();
+ td mt "_vnpage_publisher";
+ td;
+ for my $l (@lang) {
+ my %p = map $_->{publisher} ? ($_->{id} => $_) : (), map @{$_->{producers}}, grep grep($_ eq $l, @{$_->{languages}}), @$r;
+ my @p = values %p;
+ next if !@p;
+ cssicon "lang $l", mt "_lang_$l";
+ for (@p) {
+ a href => "/p$_->{id}", title => $_->{original}||$_->{name}, shorten $_->{name}, 30;
+ txt ' & ' if $_ != $p[$#p];
+ }
+ txt "\n";
+ }
+ end;
+ end;
+ }
}