summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Chars.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2015-07-21 06:05:58 +0200
committerYorhel <git@yorhel.nl>2015-07-21 06:05:58 +0200
commit206e791b87e58f44d379a09544ec86069646d0d5 (patch)
tree8fb5b009c799d40e3e23a4ecb3e7b32fb6cddab4 /lib/VNDB/Handler/Chars.pm
parent3bbc0320fd36e45f5a7f050a28ba9b6293daa145 (diff)
Add profile option for the default spoiler setting
This fixes the unexpected behaviour that changing the spoiler setting on one page will change it for all pages. All manual spoiler changing options are temporary now.
Diffstat (limited to 'lib/VNDB/Handler/Chars.pm')
-rw-r--r--lib/VNDB/Handler/Chars.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/VNDB/Handler/Chars.pm b/lib/VNDB/Handler/Chars.pm
index f667d41b..c59d44b9 100644
--- a/lib/VNDB/Handler/Chars.pm
+++ b/lib/VNDB/Handler/Chars.pm
@@ -66,10 +66,9 @@ sub page {
div class => 'mainbox';
$self->htmlItemMessage('c', $r);
+ my $spoil = $self->authPref('spoilers')||0;
p id => 'charspoil_sel';
- a href => '#', class => 'sel', mt '_spoilset_0';
- a href => '#', mt '_spoilset_1';
- a href => '#', mt '_spoilset_2';
+ a href => '#', $spoil == $_ ? (class => 'sel') : (), mt "_spoilset_$_" for (0..2);
end;
h1 $r->{name};
h2 class => 'alttitle', $r->{original} if $r->{original};
@@ -487,7 +486,9 @@ sub list {
);
return $self->resNotFound if $f->{_err};
- my($list, $np) = $self->filFetchDB(char => $f->{fil}, {}, {
+ my($list, $np) = $self->filFetchDB(char => $f->{fil}, {
+ tagspoil => $self->authPref('spoilers')||0,
+ }, {
$fch ne 'all' ? ( char => $fch ) : (),
$f->{q} ? ( search => $f->{q} ) : (),
results => 50,