diff options
author | Yorhel <git@yorhel.nl> | 2019-11-12 20:15:32 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2019-11-12 20:19:55 +0100 |
commit | 06bacb61526f3945520dd344821d2aa7b85a5f43 (patch) | |
tree | 81e7469ab7ac1c1e3e2a80f79cf49022083f89b6 /lib/VNDB/Handler/Producers.pm | |
parent | e525c5fb92612e5459ab04b1c010fb88a3dfa22a (diff) |
v2rw: Move entryLinks() into separate VNDB::ExtLinks module
This is yak shaving. The new module doesn't have much value as it is,
apart from having a central place to define link formats. This new
enrich_extlinks() approach is also a bit more efficient in that it can
avoid separate SQL queries for multiple objects.
But the real reason for these changes is that I can use that %LINKS hash
table to automatically generate the links part in the edit summary and
it should (hopefully) also be useful to generate a more
convenient/streamlined Elm edit form.
Diffstat (limited to 'lib/VNDB/Handler/Producers.pm')
-rw-r--r-- | lib/VNDB/Handler/Producers.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm index 75ca792f..7a1a287c 100644 --- a/lib/VNDB/Handler/Producers.pm +++ b/lib/VNDB/Handler/Producers.pm @@ -6,6 +6,7 @@ use warnings; use TUWF ':html', ':xml', 'xml_escape', 'html_escape'; use VNDB::Func; use VNDB::Types; +use VNDB::ExtLinks; TUWF::register( @@ -50,6 +51,7 @@ sub page { $rev ? ( rev => $rev ) : () )->[0]; return $self->resNotFound if !$p->{id}; + enrich_extlinks p => $p; my $metadata = { 'og:title' => $p->{name}, @@ -95,11 +97,10 @@ sub page { txt "a.k.a. $alias"; } - my $links = $self->entryLinks(p => $p); - br if @$links; - for(@$links) { + br if $p->{extlinks}->@*; + for($p->{extlinks}->@*) { a href => $_->[1], $_->[0]; - txt ' - ' if $_ ne $links->[$#$links]; + txt ' - ' if $_ ne $p->{extlinks}[$#{$p->{extlinks}}]; } end 'p'; @@ -138,6 +139,8 @@ sub _releases { # prodpage_(dev|pub) my $r = $self->dbReleaseGet(pid => $p->{id}, results => 999, what => 'vn platforms links'); + enrich_extlinks r => $r; + div class => 'mainbox'; a href => '#', id => 'expandprodrel', 'collapse'; h1 'Releases'; |