summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-01-08 14:22:24 +0100
committerYorhel <git@yorhel.nl>2020-01-08 14:22:26 +0100
commited6abcb87a70091b3813ca7be8b520572c6a5133 (patch)
treec64c2994a6c3f9612832da9951b72c03d2092e10
parent4785ca2125ce58f00057039c971121f6d889cc3c (diff)
ulist: Disable voting from /u+/ulist for unreleased VNs
The logic to determine whether it's been released is different from the vote widget on the VN page - that one is more lax in that it also allows trials. This inconsistency is ugly but not easy to fix.
-rw-r--r--lib/VNWeb/User/Lists.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VNWeb/User/Lists.pm b/lib/VNWeb/User/Lists.pm
index c1beb4f4..1961c962 100644
--- a/lib/VNWeb/User/Lists.pm
+++ b/lib/VNWeb/User/Lists.pm
@@ -1,6 +1,7 @@
package VNWeb::User::Lists;
use VNWeb::Prelude;
+use POSIX 'strftime';
# Do we have "ownership" access to this users' list (i.e. can we edit and see private stuff)?
@@ -381,7 +382,8 @@ sub vn_ {
td_ mkclass(tc_vote => 1, compact => $own, stealth => $own), sub {
txt_ fmtvote $v->{vote} if !$own;
- elm_ 'UList.VoteEdit' => $VNVOTE, { uid => $uid, vid => $v->{id}, vote => fmtvote($v->{vote}) }, fmtvote $v->{vote} if $own;
+ elm_ 'UList.VoteEdit' => $VNVOTE, { uid => $uid, vid => $v->{id}, vote => fmtvote($v->{vote}) }, fmtvote $v->{vote}
+ if $own && sprintf('%08d', $v->{c_released}||0) < strftime '%Y%m%d', gmtime;
} if in vote => $opt->{c};
td_ class => 'tc_rating', sub {