diff options
author | morkt <> | 2015-02-04 14:02:55 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2015-02-04 14:02:55 +0100 |
commit | 9e4722f6e09f8e52b0d88e9d37afcc3e78155793 (patch) | |
tree | 441c2ff7ecbb5d2114bc2269e3e96c12457847ad /lib/VNDB/Handler/VNPage.pm | |
parent | 9087dbb5c6fd238676347946918accc27a736201 (diff) |
Add spoiler settings to /v+/staff
Diffstat (limited to 'lib/VNDB/Handler/VNPage.pm')
-rw-r--r-- | lib/VNDB/Handler/VNPage.pm | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm index c943f5f8..fbaf00d7 100644 --- a/lib/VNDB/Handler/VNPage.pm +++ b/lib/VNDB/Handler/VNPage.pm @@ -1126,11 +1126,18 @@ sub _staff { end 'table'; end; } - my @seiyuu = grep !$_->{spoil}, @{$v->{seiyuu}}; - if(@seiyuu) { + if(@{$v->{seiyuu}}) { + my($has_spoilers, $has_notes); + $has_spoilers ||= $_->{spoil}, $has_notes ||= $_->{note} for @{$v->{seiyuu}}; div class => 'mainbox staff cast'; + if($has_spoilers) { + p id => 'charspoil_sel'; + a href => '#', class => 'sel', mt '_vnpage_tags_spoil0'; + a href => '#', mt '_vnpage_tags_spoil1'; + a href => '#', mt '_vnpage_tags_spoil2'; + end; + } h1 mt '_vnpage_cast'; - my $has_notes = grep { $_->{note} } @seiyuu; table class => 'stripe'; thead; Tr; @@ -1139,9 +1146,8 @@ sub _staff { td class => 'tc3', mt '_staff_col_note' if $has_notes; end; end; - for my $s (@seiyuu) { - next if $s->{spoil}; - Tr; + for my $s (@{$v->{seiyuu}}) { + Tr $has_spoilers ? (class => charspoil($s->{spoil})) : (); td class => 'tc1'; a href => "/c$s->{cid}", $s->{cname}; end; |