summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Producers.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-10-21 11:40:53 +0200
committerYorhel <git@yorhel.nl>2009-10-21 11:40:53 +0200
commit25bbbe2d974ea83fc01c2053354b05b62c5d6167 (patch)
treeade85bbd6d09e606162ab134af1a70add86d1d83 /lib/VNDB/Handler/Producers.pm
parent06a2e823c738a622625dce599fa19580714834a5 (diff)
Display producer relations in revision browser
And again copied something from the VN relation code... meh.
Diffstat (limited to 'lib/VNDB/Handler/Producers.pm')
-rw-r--r--lib/VNDB/Handler/Producers.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index 2a3991ba..97260dde 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -3,7 +3,7 @@ package VNDB::Handler::Producers;
use strict;
use warnings;
-use YAWF ':html', ':xml';
+use YAWF ':html', ':xml', 'xml_escape';
use VNDB::Func;
@@ -21,7 +21,7 @@ sub page {
my $p = $self->dbProducerGet(
id => $pid,
- what => 'vn extended'.($rev ? ' changes' : ''),
+ what => 'vn extended relations'.($rev ? ' changes' : ''),
$rev ? ( rev => $rev ) : ()
)->[0];
return 404 if !$p->{id};
@@ -31,7 +31,7 @@ sub page {
return if $self->htmlHiddenMessage('p', $p);
if($rev) {
- my $prev = $rev && $rev > 1 && $self->dbProducerGet(id => $pid, rev => $rev-1, what => 'changes extended')->[0];
+ my $prev = $rev && $rev > 1 && $self->dbProducerGet(id => $pid, rev => $rev-1, what => 'changes extended relations')->[0];
$self->htmlRevision('p', $prev, $p,
[ type => serialize => sub { mt "_ptype_$_[0]" } ],
[ name => diff => 1 ],
@@ -40,6 +40,12 @@ sub page {
[ lang => serialize => sub { "$_[0] (".mt("_lang_$_[0]").')' } ],
[ website => diff => 1 ],
[ desc => diff => 1 ],
+ [ relations => join => '<br />', split => sub {
+ my @r = map sprintf('%s: <a href="/p%d" title="%s">%s</a>',
+ mt("_prodrel_$_->{relation}"), $_->{id}, xml_escape($_->{original}||$_->{name}), xml_escape shorten $_->{name}, 40
+ ), sort { $a->{id} <=> $b->{id} } @{$_[0]};
+ return @r ? @r : (mt '_proddiff_none');
+ }],
);
}