summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-03-21 13:21:25 +0100
committerYorhel <git@yorhel.nl>2009-03-21 13:21:25 +0100
commitcbfb086feab8d06e8184f7b8d809780404d091bf (patch)
treeec3d668f004fda2de76df3aaccf0a038ead9856c /lib
parent53ebdbc751f742e74ef33fb2a20dcd089c73cfd0 (diff)
Show/hide spoiler tags on VN pages
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/VNPage.pm16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index 69142a94..da8fe570 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -138,14 +138,20 @@ sub page {
end;
clearfloat;
- # description
+ # tags
my $t = $self->dbTagStats(vid => $v->{id}, order => 'avg(tv.vote) DESC', minrating => 0);
if(@$t) {
- div class => 'vntags';
+ div id => 'tagops';
+ a href => '#', 'hide spoilers';
+ a href => '#', class => 'tsel', 'show minor spoilers';
+ a href => '#', 'all tags';
+ end;
+ div id => 'vntags';
for (@$t) {
- a href => "/g$_->{id}", style => sprintf('font-size: %dpx', $_->{rating}*3.5+6), $_->{name};
- b class => 'grayedout', style => 'font-size: 8px', sprintf ' %.1f', $_->{rating};
- lit '&nbsp;&nbsp;&nbsp; ';
+ span class => sprintf 'tagspl%.0f %s', $_->{spoiler}, $_->{spoiler} > 1 ? 'hidden' : '';
+ a href => "/g$_->{id}", style => sprintf('font-size: %dpx', $_->{rating}*3.5+6), $_->{name};
+ b class => 'grayedout', sprintf ' %.1f', $_->{rating};
+ end;
}
end;
}