summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-07-13 12:17:50 +0200
committerYorhel <git@yorhel.nl>2020-07-13 12:17:52 +0200
commit1690494ea55ae3e1e4fa002d5fd8bd1999c431a5 (patch)
tree1d60c3723d7f030e96ffc50fa0757ba1a3e8e0b4
parentf23f9a67e17c6678bcf7ff7a32b867ba0ee80962 (diff)
VNEdit: Fix flagging of new screenshotsHEADmaster
Two bugs: The lack of Html.Keyed caused the 'checked' value of subsequent radio buttons to not update correctly & the name of the radio buttons was the same everywhere, resulting in https://vndb.org/v21894.16
-rw-r--r--elm/Lib/Image.elm2
-rw-r--r--elm/VNEdit.elm11
2 files changed, 8 insertions, 5 deletions
diff --git a/elm/Lib/Image.elm b/elm/Lib/Image.elm
index 3a20c648..31bab0b3 100644
--- a/elm/Lib/Image.elm
+++ b/elm/Lib/Image.elm
@@ -152,7 +152,7 @@ viewVote model =
, required True
, onCheck <| (if sex then MySex else MyVio) val
, checked <| (if sex then i.my_sexual else i.my_violence) == Just val
- , name <| "imgvote-" ++ (if sex then "sex" else "vio") ++ "-" ++ Maybe.withDefault "" (Maybe.map (\e -> e.id) i.entry)
+ , name <| "imgvote-" ++ (if sex then "sex" else "vio") ++ "-" ++ Maybe.withDefault "" model.id
] []
vote i = table []
[ thead [] [ tr []
diff --git a/elm/VNEdit.elm b/elm/VNEdit.elm
index 4e442815..3c6f06a6 100644
--- a/elm/VNEdit.elm
+++ b/elm/VNEdit.elm
@@ -475,7 +475,7 @@ view model =
let
showrel r = "[" ++ (RDate.format (RDate.expand r.released)) ++ " " ++ (String.join "," r.lang) ++ "] " ++ r.title ++ " (r" ++ String.fromInt r.id ++ ")"
rellist = List.map (\r -> (Just r.id, showrel r)) model.releases
- scr n (id, i, rel) = tr [] <|
+ scr n (id, i, rel) = (String.fromInt id, tr [] <|
let getdim img = Maybe.map (\nfo -> (nfo.width, nfo.height)) img |> Maybe.withDefault (0,0)
imgdim = getdim i.img
relnfo = List.filter (\r -> Just r.id == rel) model.releases |> List.head
@@ -510,7 +510,7 @@ view model =
(Nothing, Just r) -> [(Just r, "[Deleted or unlinked release: r" ++ String.fromInt r ++ "]")]
_ -> []
]
- ]
+ ])
add =
let free = 10 - List.length model.screenshots
@@ -553,8 +553,11 @@ view model =
, a [ href <| "/v" ++ Maybe.withDefault "" (Maybe.map String.fromInt model.id) ++ "/add" ] [ text "add the appropriate release entries" ]
, text " first and then come back to this form to upload screenshots."
]
- else table [ class "vnedit_scr" ]
- <| tfoot [] [ tr [] [ td [] [], td [ colspan 2 ] add ] ] :: List.indexedMap scr model.screenshots
+ else
+ table [ class "vnedit_scr" ]
+ [ tfoot [] [ tr [] [ td [] [], td [ colspan 2 ] add ] ]
+ , K.node "tbody" [] <| List.indexedMap scr model.screenshots
+ ]
newform () =
form_ DupSubmit (model.state == Api.Loading)