diff options
author | Yorhel <git@yorhel.nl> | 2008-11-20 19:58:40 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2008-11-20 19:58:40 +0100 |
commit | 416d2db0bc9a8d1d98216c27fbbd8c2f7c7a2fe6 (patch) | |
tree | da58a1309a8cca4ef4bc8d27be0e989c64ae7992 /lib | |
parent | 36965ef4a51ebdd341e5a9e63a77e8c7bb736d6f (diff) |
Proper handing of NSFW VN images
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/Handler/VNPage.pm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm index 7aaf6eaf..9f8055eb 100644 --- a/lib/VNDB/Handler/VNPage.pm +++ b/lib/VNDB/Handler/VNPage.pm @@ -32,11 +32,20 @@ sub page { # image div class => 'vnimg'; - # TODO: check for img_nsfw and processing flag - if($v->{image}) { - img src => sprintf("%s/cv/%02d/%d.jpg", $self->{url_static}, $v->{image}%100, $v->{image}), alt => $v->{title}; - } else { + if(!$v->{image}) { p 'No image uploaded yet'; + } elsif($v->{image} < 0) { + p '[processing image, please return in a few minutes]'; + } elsif($v->{img_nsfw} && !$self->authInfo->{show_nsfw}) { + img id => 'nsfw_hid', src => sprintf("%s/cv/%02d/%d.jpg", $self->{url_static}, $v->{image}%100, $v->{image}), alt => $v->{title}; + p id => 'nsfw_show'; + txt "This image has been flagged\nas Not Safe For Work.\n\n"; + a href => '#', id => 'nsfw_show', 'Show me anyway'; + txt "\n\n(This warning can be disabled in your account)"; + end; + } else { + img src => sprintf("%s/cv/%02d/%d.jpg", $self->{url_static}, $v->{image}%100, $v->{image}), alt => $v->{title}; + i 'Flagged as NSFW' if $v->{img_nsfw} && $self->authInfo->{show_nsfw}; } end; |