summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler
diff options
context:
space:
mode:
authorzx14 <zx14@vndb.org>2018-10-22 08:30:53 +0700
committerAlexander-- <alexander.r@gmx.com>2018-10-23 00:04:14 +0700
commit22b070a421fd15435cd10d4084fea05526660c11 (patch)
treed9a07b5173f63f266510f1937f2d4ec529f3fb3e /lib/VNDB/Handler
parentca1117d0d6476b94466eb99a79571e495071a90a (diff)
Add JS-less NSFW toggle
Diffstat (limited to 'lib/VNDB/Handler')
-rw-r--r--lib/VNDB/Handler/VNPage.pm27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index 0bf9ec4d..6dfcdcd6 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -367,18 +367,25 @@ sub page {
if(!$v->{image}) {
p 'No image uploaded yet';
} else {
- p $v->{img_nsfw} ? (id => 'nsfw_hid', $self->authPref('show_nsfw') ? () : (class => 'hidden')) : ();
- img src => imgurl(cv => $v->{image}), alt => $v->{title};
- i 'Flagged as NSFW' if $v->{img_nsfw};
- end;
if($v->{img_nsfw}) {
- p id => 'nsfw_show', $self->authPref('show_nsfw') ? (class => 'hidden') : ();
- txt 'This image has been flagged as Not Safe For Work.';
- br; br;
- a href => '#', 'Show me anyway';
- br; br;
- txt '(This warning can be disabled in your account)';
+ p class => 'nsfw_pic';
+ input id => 'nsfw_chk', type => 'checkbox', class => 'visuallyhidden', $self->authPref('show_nsfw') ? (checked => 'checked') : ();
+ label for => 'nsfw_chk';
+ span id => 'nsfw_show';
+ txt 'This image has been flagged as Not Safe For Work.';
+ br; br;
+ span class => 'fake_link', 'Show me anyway';
+ br; br;
+ txt '(This warning can be disabled in your account)';
+ end;
+ span id => 'nsfw_hid';
+ img src => imgurl(cv => $v->{image}), alt => $v->{title};
+ i 'Flagged as NSFW';
+ end;
+ end;
end;
+ } else {
+ img src => imgurl(cv => $v->{image}), alt => $v->{title};
}
}
end 'div'; # /vnimg