diff options
author | Yorhel <git@yorhel.nl> | 2019-08-27 11:42:23 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-08-27 11:42:26 +0200 |
commit | c076ee02e0dac255b8d8ab1d1fe04b67061aa364 (patch) | |
tree | 320f96a9eebe4968498877b937854e6f2edd8bc9 /lib/VNDB/Handler/Releases.pm | |
parent | 81d495fd580503a02691b90f00bcac6c1bc7dcca (diff) |
Also display release link dropdown on producer pages
https://vndb.org/t12755.28
Diffstat (limited to 'lib/VNDB/Handler/Releases.pm')
-rw-r--r-- | lib/VNDB/Handler/Releases.pm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm index 164b457d..e011246b 100644 --- a/lib/VNDB/Handler/Releases.pm +++ b/lib/VNDB/Handler/Releases.pm @@ -5,6 +5,9 @@ use strict; use warnings; use TUWF ':html', ':xml', 'uri_escape', 'xml_escape'; use VNDB::Func; +use Exporter 'import'; + +our @EXPORT = ('releaseExtLinks'); TUWF::register( @@ -790,5 +793,32 @@ sub enginexml { } +# Generate the html for an 'external links' dropdown +sub releaseExtLinks { + my($self, $r) = @_; + my $links = $self->entryLinks(r => $r); + my $has_dd = @$links > ($r->{website} ? 1 : 0); + if(@$links) { + a href => $r->{website}||'#', class => 'rllinks'; + txt scalar @$links if $has_dd; + cssicon 'external', 'External link'; + end; + if($has_dd) { + ul class => 'hidden rllinks_dd'; + for (@$links) { + li; + a href => $_->[1]; + span $_->[2] if $_->[2]; + txt $_->[0]; + end; + end; + }; + end; + } + } else { + txt ' '; + } +} + 1; |