summaryrefslogtreecommitdiff
path: root/lib/VNDB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-05-28 16:39:38 +0200
committerYorhel <git@yorhel.nl>2020-05-28 16:39:40 +0200
commite36bfde55478f4ae5d83ee73845a348a92386bca (patch)
tree932eea74bd2b29dbac5065c810691c731ef30e63 /lib/VNDB
parent002f165ed4823b7563e7443526d907d27b5b431b (diff)
Drop ReleaseExtLinks.elm in favor of pure CSS solution
It's the only Elm module used on VN pages for not-logged-in visitors, so doing this in CSS makes it possible to not load an Elm bundle on those pages (when I get to splitting up the JS files). This solution also simplifies code reuse with the producer pages, but a v2rw migration of that page would have taken care of that as well.
Diffstat (limited to 'lib/VNDB')
-rw-r--r--lib/VNDB/Handler/Producers.pm2
-rw-r--r--lib/VNDB/Handler/Releases.pm30
2 files changed, 1 insertions, 31 deletions
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index 9be2a75c..4457c9b6 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -170,7 +170,7 @@ sub _releases {
td class => 'tc5', join ', ',
($rel->{developer} ? 'developer' : ()), ($rel->{publisher} ? 'publisher' : ());
td class => 'tc6';
- $self->releaseExtLinks($rel);
+ VNWeb::Releases::Lib::release_extlinks_($rel);
end;
end 'tr';
}
diff --git a/lib/VNDB/Handler/Releases.pm b/lib/VNDB/Handler/Releases.pm
index 0e7c8933..72f32106 100644
--- a/lib/VNDB/Handler/Releases.pm
+++ b/lib/VNDB/Handler/Releases.pm
@@ -6,9 +6,6 @@ use warnings;
use TUWF ':html', ':xml', 'uri_escape';
use VNDB::Func;
use VNDB::Types;
-use Exporter 'import';
-
-our @EXPORT = ('releaseExtLinks');
TUWF::register(
@@ -213,32 +210,5 @@ sub enginexml {
end;
}
-
-# Generate the html for an 'external links' dropdown, assumes enrich_extlinks() has already been called on this object.
-sub releaseExtLinks {
- my($self, $r) = @_;
- my $has_dd = $r->{extlinks}->@* > ($r->{website} ? 1 : 0);
- if($r->{extlinks}->@*) {
- a href => $r->{website}||'#', class => 'rllinks';
- txt scalar $r->{extlinks}->@* if $has_dd;
- cssicon 'external', 'External link';
- end;
- if($has_dd) {
- ul class => 'hidden rllinks_dd';
- for ($r->{extlinks}->@*) {
- li;
- a href => $_->[1];
- span $_->[2] if $_->[2];
- txt $_->[0];
- end;
- end;
- };
- end;
- }
- } else {
- txt ' ';
- }
-}
-
1;