summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-04-26 11:16:31 +0200
committerYorhel <git@yorhel.nl>2020-04-26 11:16:31 +0200
commit38f3ae4fc9b3109d481e0d76db02bfd97e2222d4 (patch)
tree3ae49b6c0b3ec79c36fb4f686abff5a6d48e2715 /lib
parent0d48607c50d9627d41249d30bb1125fe18fb8683 (diff)
imgflag: Honor show_nsfw setting for /img/<id> + hide excl_voted checkbox when single=1
Diffstat (limited to 'lib')
-rw-r--r--lib/VNWeb/Images/List.pm5
-rw-r--r--lib/VNWeb/Images/Vote.pm2
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/VNWeb/Images/List.pm b/lib/VNWeb/Images/List.pm
index 8cbe24aa..a073982b 100644
--- a/lib/VNWeb/Images/List.pm
+++ b/lib/VNWeb/Images/List.pm
@@ -46,12 +46,13 @@ sub graph_ {
sub listing_ {
my($lst, $np, $opt, $url) = @_;
+ my $view = viewset(show_nsfw => 1);
paginate_ $url, $opt->{p}, $np, 't';
div_ class => 'mainbox imagebrowse', sub {
div_ class => 'imagecard', sub {
- a_ href => "/img/$_->{id}", style => 'background-image: url('.tuwf->imgurl($_->{id}, 1).')', '';
+ a_ href => "/img/$_->{id}?view=$view", style => 'background-image: url('.tuwf->imgurl($_->{id}, 1).')', '';
div_ sub {
- a_ href => "/img/$_->{id}", $_->{id};
+ a_ href => "/img/$_->{id}?view=$view", $_->{id};
txt_ sprintf ' / %d', $_->{c_votecount},;
b_ class => 'grayedout', sprintf ' / w%.1f', $_->{c_weight};
br_;
diff --git a/lib/VNWeb/Images/Vote.pm b/lib/VNWeb/Images/Vote.pm
index db8bf83f..ba7047ef 100644
--- a/lib/VNWeb/Images/Vote.pm
+++ b/lib/VNWeb/Images/Vote.pm
@@ -192,7 +192,7 @@ TUWF::get qr{/img/$RE{imgid}}, sub {
enrich_token defined($l->[0]{my_sexual}) || auth->permImgmod(), $l;
framework_ title => "Image flagging for $id", sub {
- imgflag_ images => $l, single => 1, warn => !tuwf->samesite();
+ imgflag_ images => $l, single => 1, warn => !viewget->{show_nsfw};
};
};