summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Releases
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-04-20 09:27:27 +0200
committerYorhel <git@yorhel.nl>2020-04-20 14:16:54 +0200
commitde2a0b3cb152175e7b8df28e97fb532d1021f20c (patch)
treedf03548756feca0b0b6874b7de1c0a880640860c /lib/VNWeb/Releases
parent17445db2d7d7ce34616e21dd5cce6d8c81b66c21 (diff)
v2rw/VN::Page: Add releases listing
Biggest visible change here is that external links now require a click to show the dropdown box. I hadn't implemented a hover-style dropdown in Elm yet. I'm not sure yet which solution I like better.
Diffstat (limited to 'lib/VNWeb/Releases')
-rw-r--r--lib/VNWeb/Releases/Lib.pm24
-rw-r--r--lib/VNWeb/Releases/Page.pm2
2 files changed, 25 insertions, 1 deletions
diff --git a/lib/VNWeb/Releases/Lib.pm b/lib/VNWeb/Releases/Lib.pm
new file mode 100644
index 00000000..a5853504
--- /dev/null
+++ b/lib/VNWeb/Releases/Lib.pm
@@ -0,0 +1,24 @@
+package VNWeb::Releases::Lib;
+
+use VNWeb::Prelude;
+use Exporter 'import';
+
+our @EXPORT = qw/release_extlinks_/;
+
+
+# Generate the html for an 'external links' dropdown, assumes enrich_extlinks() has already been called on this object.
+sub release_extlinks_ {
+ my($r, $id) = @_;
+ return if !$r->{extlinks}->@*;
+ my $has_dd = $r->{extlinks}->@* > ($r->{website} ? 1 : 0);
+ my sub icon_ {
+ a_ href => $r->{website}||'#', sub {
+ txt_ scalar $r->{extlinks}->@* if $has_dd;
+ abbr_ class => 'icons external', title => 'External link', '';
+ }
+ }
+ elm_ ReleaseExtLinks => undef, [ ''.($id||$r->{id}), $r->{extlinks} ], \&icon_ if $has_dd;
+ icon_ if !$has_dd;
+}
+
+1;
diff --git a/lib/VNWeb/Releases/Page.pm b/lib/VNWeb/Releases/Page.pm
index d0c6d620..77a50f27 100644
--- a/lib/VNWeb/Releases/Page.pm
+++ b/lib/VNWeb/Releases/Page.pm
@@ -193,7 +193,7 @@ sub _infotable_ {
td_ sub {
div_ class => 'elm_dd_input', style => 'width: 150px', sub {
my $d = tuwf->dbVali('SELECT status FROM rlists WHERE', { rid => $r->{id}, uid => auth->uid });
- elm_ 'UList.ReleaseEdit', $VNWeb::User::Lists::RLIST_STATUS, { rid => $r->{id}, uid => auth->uid, status => $d };
+ elm_ 'UList.ReleaseEdit', $VNWeb::User::Lists::RLIST_STATUS, { rid => $r->{id}, uid => auth->uid, status => $d, empty => 'not on your list' };
}
};
} if auth;