diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/Types.pm | 5 | ||||
-rw-r--r-- | lib/VNWeb/AdvSearch.pm | 1 | ||||
-rw-r--r-- | lib/VNWeb/Elm.pm | 1 | ||||
-rw-r--r-- | lib/VNWeb/VN/Edit.pm | 1 | ||||
-rw-r--r-- | lib/VNWeb/VN/Page.pm | 19 |
5 files changed, 19 insertions, 8 deletions
diff --git a/lib/VNDB/Types.pm b/lib/VNDB/Types.pm index 9a4ab892..684c3602 100644 --- a/lib/VNDB/Types.pm +++ b/lib/VNDB/Types.pm @@ -134,6 +134,11 @@ hash VN_RELATION => orig => { reverse => 'fan', pref => 0, txt => 'Original game' }; +hash DEVSTATUS => + 0 => 'Finished', + 1 => 'In development', + 2 => 'Cancelled'; + # SQL: ENUM producer_relation # "Pref" relations are considered the "preferred" relation to show (as opposed to their reverse) diff --git a/lib/VNWeb/AdvSearch.pm b/lib/VNWeb/AdvSearch.pm index 8b5343d7..f322c433 100644 --- a/lib/VNWeb/AdvSearch.pm +++ b/lib/VNWeb/AdvSearch.pm @@ -323,6 +323,7 @@ f v => 62 => 'has-anime', { uint => 1, range => [1,1] }, '=' => sub { 'EXI f v => 63 => 'has-screenshot', { uint => 1, range => [1,1] }, '=' => sub { 'EXISTS(SELECT 1 FROM vn_screenshots vs WHERE vs.id = v.id)' }; f v => 64 => 'has-review', { uint => 1, range => [1,1] }, '=' => sub { 'EXISTS(SELECT 1 FROM reviews r WHERE r.vid = v.id AND NOT r.c_flagged)' }; f v => 65 => 'on-list', { uint => 1, range => [1,1] }, '=' => sub { auth ? sql 'v.id IN(SELECT vid FROM ulist_vns WHERE uid =', \auth->uid, ')' : '1=0' }; +f v => 66 => 'devstatus', { uint => 1, enum => \%DEVSTATUS }, '=' => sub { 'v.devstatus =', \$_ }; f v => 8 => 'tag', { type => 'any', func => \&_validate_tag }, compact => sub { my $id = ($_->[0] =~ s/^g//r)*1; $_->[1] == 0 && $_->[2] == 0 ? $id : [ $id, int($_->[2]*5)*3 + $_->[1] ] }, diff --git a/lib/VNWeb/Elm.pm b/lib/VNWeb/Elm.pm index f6ee14a2..08029680 100644 --- a/lib/VNWeb/Elm.pm +++ b/lib/VNWeb/Elm.pm @@ -452,6 +452,7 @@ sub write_types { $data .= def boardTypes => 'List (String, String)' => list map tuple(string $_, string $BOARD_TYPE{$_}{txt}), keys %BOARD_TYPE; $data .= def ratings => 'List String' => list map string(fmtrating $_), 1..10; $data .= def ageRatings => 'List (Int, String)' => list map tuple($_, string $AGE_RATING{$_}{txt}.($AGE_RATING{$_}{ex}?" ($AGE_RATING{$_}{ex})":'')), keys %AGE_RATING; + $data .= def devStatus => 'List (Int, String)' => list map tuple($_, string $DEVSTATUS{$_}), keys %DEVSTATUS; $data .= def voiced => 'List (Int, String)' => list map tuple($_, string $VOICED{$_}{txt}), keys %VOICED; $data .= def animated => 'List (Int, String)' => list map tuple($_, string $ANIMATED{$_}{txt}), keys %ANIMATED; $data .= def genders => 'List (String, String)' => list map tuple(string $_, string $GENDER{$_}), keys %GENDER; diff --git a/lib/VNWeb/VN/Edit.pm b/lib/VNWeb/VN/Edit.pm index 204e965d..0cacbb0f 100644 --- a/lib/VNWeb/VN/Edit.pm +++ b/lib/VNWeb/VN/Edit.pm @@ -15,6 +15,7 @@ my $FORM = { } }, alias => { required => 0, default => '', maxlength => 500 }, desc => { required => 0, default => '', maxlength => 10240 }, + devstatus => { uint => 1, enum => \%DEVSTATUS }, olang => { enum => \%LANGUAGE, default => 'ja' }, length => { uint => 1, enum => \%VN_LENGTH }, l_wikidata => { required => 0, uint => 1, max => (1<<31)-1 }, diff --git a/lib/VNWeb/VN/Page.pm b/lib/VNWeb/VN/Page.pm index 72fc852a..439db889 100644 --- a/lib/VNWeb/VN/Page.pm +++ b/lib/VNWeb/VN/Page.pm @@ -97,6 +97,7 @@ sub rev_ { [ alias => 'Alias' ], [ olang => 'Original language', fmt => \%LANGUAGE ], [ desc => 'Description' ], + [ devstatus => 'Development status',fmt => \%DEVSTATUS ], [ length => 'Length', fmt => \%VN_LENGTH ], [ staff => 'Credits', fmt => sub { a_ href => "/$_->{sid}", title => $_->{original}||$_->{name}, $_->{name} if $_->{sid}; @@ -162,14 +163,8 @@ sub infobox_relations_ { sub infobox_length_ { my($v) = @_; - my $today = strftime('%Y%m%d', gmtime); - - # Length is only relevant if this VN has been released. Some VNs have been - # cancelled and only have a trial, but we allow votes on those as well. - my $hastrial = grep $_->{rtype} eq 'trial' && $_->{released} <= $today, $v->{releases}->@*; - my $hasnontba = grep $_->{rtype} ne 'trial' && $_->{released} <= $today, $v->{releases}->@*; - my $hastba = grep $_->{rtype} ne 'trial' && $_->{released} > $today, $v->{releases}->@*; - return if !($hasnontba || ($hastrial && !$hastba)); + # Length is only relevant if this VN is finalized in some form. + return if $v->{devstatus} == 1; return if !$v->{length} && !$v->{c_lengthnum} && !VNWeb::VN::Length::can_vote(); @@ -431,6 +426,14 @@ sub infobox_ { td_ $v->{alias} =~ s/\n/, /gr; } if $v->{alias}; + tr_ sub { + td_ 'Status'; + td_ sub { + txt_ 'In development' if $v->{devstatus} == 1; + txt_ 'Unfinished, no ongoing development' if $v->{devstatus} == 2; + }; + } if $v->{devstatus}; + infobox_length_ $v; infobox_producers_ $v; infobox_relations_ $v; |