diff options
author | Yorhel <git@yorhel.nl> | 2021-03-04 12:00:13 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-03-04 12:06:17 +0100 |
commit | 7c9e24b57a5eaa1b026833ca11cba7a451cf8556 (patch) | |
tree | 0a4ace42210152f55da88424b75c7fa688120f61 /elm | |
parent | 5d54a844aba404e16280dcbd1ec3dffc9be4dfe1 (diff) |
Releases: Store unknown minage as NULL + fix default for new entries
Fixes https://vndb.org/t950.905, which also reminded me that I can now
finally store unknown as NULL rather than -1. The v2rw rewrite was
preventing me from changing that earlier, handling NULLs was more
annoying in the old v2 code.
Diffstat (limited to 'elm')
-rw-r--r-- | elm/AdvSearch/Range.elm | 2 | ||||
-rw-r--r-- | elm/ReleaseEdit.elm | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/elm/AdvSearch/Range.elm b/elm/AdvSearch/Range.elm index bfd6b0a6..7bdcbfdf 100644 --- a/elm/AdvSearch/Range.elm +++ b/elm/AdvSearch/Range.elm @@ -204,7 +204,7 @@ votecountView = view False "# Votes" String.fromInt -minageInit dat = (dat, { op = Lt, val = 13, unk = False, lst = Array.fromList <| List.map Tuple.first <| List.drop 1 GT.ageRatings }) +minageInit dat = (dat, { op = Lt, val = 13, unk = False, lst = Array.fromList <| List.map Tuple.first GT.ageRatings }) minageFromQuery d q = case q of diff --git a/elm/ReleaseEdit.elm b/elm/ReleaseEdit.elm index 280a12cb..ed5d94d5 100644 --- a/elm/ReleaseEdit.elm +++ b/elm/ReleaseEdit.elm @@ -48,7 +48,7 @@ type alias Model = , gtinValid : Bool , catalog : String , released : D.RDate - , minage : Int + , minage : Maybe Int , uncensored : Bool , resoX : Int , resoY : Int @@ -176,7 +176,7 @@ type Msg | Gtin String | Catalog String | Released D.RDate - | Minage Int + | Minage (Maybe Int) | Uncensored Bool | Resolution (A.Msg GApi.ApiResolutions) | Voiced Int @@ -299,7 +299,7 @@ viewGen model = , tr [ class "newpart" ] [ td [] [] ] , formField "rtype::Type" [ inputSelect "rtype" model.rtype RType [] GT.releaseTypes ] - , formField "minage::Age rating" [ inputSelect "minage" model.minage Minage [] GT.ageRatings, text " (*)" ] + , formField "minage::Age rating" [ inputSelect "minage" model.minage Minage [] ((Nothing, "Unknown") :: List.map (Tuple.mapFirst Just) GT.ageRatings), text " (*)" ] , formField "" [ label [] [ inputCheck "" model.official Official, text " Official (i.e. sanctioned by the original developer of the visual novel)" ] ] , formField "" [ label [] [ inputCheck "" model.patch Patch , text " This release is a patch to another release.", text " (*)" ] ] , formField "" [ label [] [ inputCheck "" model.freeware Freeware, text " Freeware (i.e. available at no cost)" ] ] @@ -348,10 +348,10 @@ viewGen model = , if model.patch then text "" else formField "ani_story::Animations" [ inputSelect "ani_story" model.ani_story AniStory [] GT.animated - , if model.minage == 18 then text " <= story | ero scenes => " else text "" - , if model.minage == 18 then inputSelect "" model.ani_ero AniEro [] GT.animated else text "" + , if model.minage == Just 18 then text " <= story | ero scenes => " else text "" + , if model.minage == Just 18 then inputSelect "" model.ani_ero AniEro [] GT.animated else text "" ] - , if model.minage /= 18 then text "" else + , if model.minage /= Just 18 then text "" else formField "" [ label [] [ inputCheck "" model.uncensored Uncensored, text " Uncensored (No mosaic or other optical censoring, only check if this release has erotic content)" ] ] , tr [ class "newpart" ] [ td [ colspan 2 ] [ text "External identifiers & links" ] ] |