From bd2251939c7e4c9903aa3a6eb838f489b0328bcd Mon Sep 17 00:00:00 2001 From: Yorhel Date: Wed, 21 Oct 2009 12:36:49 +0200 Subject: Display producer relations on producer pages --- lib/VNDB/Handler/Producers.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm index 97260dde..f662ba3e 100644 --- a/lib/VNDB/Handler/Producers.pm +++ b/lib/VNDB/Handler/Producers.pm @@ -62,6 +62,23 @@ sub page { } end; + if(@{$p->{relations}}) { + my %rel; + push @{$rel{$_->{relation}}}, $_ + for (sort { $a->{name} cmp $b->{name} } @{$p->{relations}}); + p class => 'center'; + txt "\n"; + for my $r (sort keys %rel) { + txt mt("_prodrel_$r").' '; + for (@{$rel{$r}}) { + a href => "/p$_->{id}", title => $_->{original}||$_->{name}, shorten $_->{name}, 40; + txt ', ' if $_ ne $rel{$r}[$#{$rel{$r}}]; + } + txt "\n"; + } + end; + } + if($p->{desc}) { p class => 'description'; lit bb2html $p->{desc}; -- cgit v1.2.3