diff options
author | Yorhel <git@yorhel.nl> | 2022-10-23 08:52:58 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2022-10-23 08:52:58 +0200 |
commit | 30dede0b26f44bb60234c2e53901d19315ecfe11 (patch) | |
tree | 21961ecbe2fd0e5f4b66ab593a778610bc0172b0 | |
parent | 09f6f99eb490b732b657c11bb39bbfea067351cf (diff) |
Reports: Hide spoiler messages
-rw-r--r-- | lib/VNWeb/Misc/Reports.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/VNWeb/Misc/Reports.pm b/lib/VNWeb/Misc/Reports.pm index a031c76e..db8334d6 100644 --- a/lib/VNWeb/Misc/Reports.pm +++ b/lib/VNWeb/Misc/Reports.pm @@ -111,8 +111,15 @@ sub report_ { br_; obj_ $r; br_; - txt_ $r->{reason}; - div_ class => 'quote', sub { lit_ bb_format $r->{message} } if $r->{message}; + if($r->{message} && $r->{reason} =~ /spoilers/i) { + details_ sub { + summary_ $r->{reason}; + div_ class => 'quote', sub { lit_ bb_format $r->{message} }; + }; + } else { + txt_ $r->{reason}; + div_ class => 'quote', sub { lit_ bb_format $r->{message} } if $r->{message}; + } }; td_ style => 'width: 300px', sub { form_ method => 'post', action => '/report/edit', sub { |