summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-11-28 17:17:22 +0100
committerYorhel <git@yorhel.nl>2009-11-28 17:17:22 +0100
commitbbfc0bb866b2ad327eb25a97d3624b9eb3a7631b (patch)
tree6d6f2bf2db2670d840250c6ce01f706750d25ebd
parent654a98a3ecc7faf359656c702eadb37f4465d42e (diff)
v+: Allow hiding of NSFW cover even if NSFW warning is disabled
-rw-r--r--ChangeLog1
-rw-r--r--data/style.css2
-rw-r--r--lib/VNDB/Handler/VNPage.pm20
3 files changed, 13 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a78e239..26336cf2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ git - ?
- Split browse functions from CommonHTML.pm into BrowseHTML.pm
- Abstracted all ORDER BY clauses in the DB abstraction layer
- Show language flags on release lists on the homepage
+ - Allow hiding of NSFW cover even if NSFW warning is disabled
2.9 - 2009-11-16
- Fixed another bug with the calculation of tags_vn_bayesian.spoiler
diff --git a/data/style.css b/data/style.css
index d6542477..cddff784 100644
--- a/data/style.css
+++ b/data/style.css
@@ -599,7 +599,7 @@ div.vnimg p {
.vndesc p {
padding: 0 0 0 5px;
}
-img#nsfw_hid {
+p#nsfw_hid {
display: none;
cursor: pointer;
}
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index cc469848..6b1c6697 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -72,16 +72,18 @@ sub page {
p mt '_vnpage_noimg';
} elsif($v->{image} < 0) {
p mt '_vnpage_imgproc';
- } 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 mt('_vnpage_imgnsfw_msg')."\n\n";
- a href => '#', mt '_vnpage_imgnsfw_show';
- txt "\n\n".mt '_vnpage_imgnsfw_note';
- end;
} else {
- img src => sprintf("%s/cv/%02d/%d.jpg", $self->{url_static}, $v->{image}%100, $v->{image}), alt => $v->{title};
- i mt '_vnpage_imgnsfw_foot' if $v->{img_nsfw} && $self->authInfo->{show_nsfw};
+ p $v->{img_nsfw} ? (id => 'nsfw_hid', style => $self->authInfo->{show_nsfw} ? 'display: block' : '') : ();
+ img src => sprintf("%s/cv/%02d/%d.jpg", $self->{url_static}, $v->{image}%100, $v->{image}), alt => $v->{title};
+ i mt '_vnpage_imgnsfw_foot' if $v->{img_nsfw};
+ end;
+ if($v->{img_nsfw}) {
+ p id => 'nsfw_show', $self->authInfo->{show_nsfw} ? (style => 'display: none') : ();
+ txt mt('_vnpage_imgnsfw_msg')."\n\n";
+ a href => '#', mt '_vnpage_imgnsfw_show';
+ txt "\n\n".mt '_vnpage_imgnsfw_note';
+ end;
+ }
}
end;