summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-09 17:41:41 +0200
committerYorhel <git@yorhel.nl>2009-10-09 17:41:41 +0200
commit4c4546ca2410844effb2edc72b80a3e1f8465f71 (patch)
tree1964139161b1bec6a8b170083100de6856761f77 /lib
parentd43ae33a587743fc0916930e0a39f561f3174a69 (diff)
Handler::Releases: Display producer role on release pages
Still the VN & producer pages to go...
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/Releases.pm27
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index 763ff59c..d771d4b1 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -61,7 +61,9 @@ sub page {
[ ani_story => serialize => sub { mt '_animated_'.$_[0] } ],
[ ani_ero => serialize => sub { mt '_animated_'.$_[0] } ],
[ producers => join => '<br />', split => sub {
- map sprintf('<a href="/p%d" title="%s">%s</a>', $_->{id}, $_->{original}||$_->{name}, shorten $_->{name}, 50), @{$_[0]};
+ map sprintf('<a href="/p%d" title="%s">%s</a> (%s)', $_->{id}, $_->{original}||$_->{name}, shorten($_->{name}, 50),
+ join(', ', $_->{developer} ? mt '_reldiff_developer' :(), $_->{publisher} ? mt '_reldiff_publisher' :())
+ ), @{$_[0]};
} ],
);
}
@@ -194,16 +196,19 @@ sub _infotable {
end;
}
- if(@{$r->{producers}}) {
- Tr ++$i % 2 ? (class => 'odd') : ();
- td mt '_relinfo_producer', scalar @{$r->{producers}};
- td;
- for (@{$r->{producers}}) {
- a href => "/p$_->{id}", title => $_->{original}||$_->{name}, shorten $_->{name}, 60;
- br if $_ != $r->{producers}[$#{$r->{producers}}];
- }
- end;
- end;
+ for my $t (qw|developer publisher|) {
+ my @prod = grep $_->{$t}, @{$r->{producers}};
+ if(@prod) {
+ Tr ++$i % 2 ? (class => 'odd') : ();
+ td mt "_relinfo_$t", scalar @prod;
+ td;
+ for (@prod) {
+ a href => "/p$_->{id}", title => $_->{original}||$_->{name}, shorten $_->{name}, 60;
+ br if $_ != $prod[$#prod];
+ }
+ end;
+ end;
+ }
}
if($r->{gtin}) {