summaryrefslogtreecommitdiff
path: root/elm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-08-25 09:48:01 +0200
committerYorhel <git@yorhel.nl>2020-08-25 09:48:01 +0200
commit4b24bbb405895d8b3bd4afc833a8c6af76103f99 (patch)
tree50bfd6f1ce5af76e182bea492c6c65e2df91cd30 /elm
parentb608999b020fce26fd7dd07078b240d18a312953 (diff)
UList.VNPage: Add link to review submit/edit form when voted
Diffstat (limited to 'elm')
-rw-r--r--elm/UList/VNPage.elm8
1 files changed, 5 insertions, 3 deletions
diff --git a/elm/UList/VNPage.elm b/elm/UList/VNPage.elm
index 7746e836..b41e6ea1 100644
--- a/elm/UList/VNPage.elm
+++ b/elm/UList/VNPage.elm
@@ -146,9 +146,11 @@ view model =
, td []
[ a [ href "#", onClickD NotesToggle ] [ text "💬" ]
, span [ class "spinner", classList [("hidden", model.notesState /= Api.Loading)] ] []
- , case model.notesState of
- Api.Error e -> b [ class "standout" ] [ text <| Api.showResponse e ]
- _ -> text ""
+ , case (model.notesState, model.vote.vote /= Nothing && model.flags.canreview, model.flags.review) of
+ (Api.Error e, _, _) -> b [ class "standout" ] [ text <| Api.showResponse e ]
+ (_, False, _) -> text ""
+ (_, True, Nothing) -> a [ href ("/v" ++ String.fromInt model.flags.vid ++ "/addreview") ] [ text " write a review »" ]
+ (_, True, Just w) -> a [ href ("/" ++ w ++ "/edit") ] [ text " edit review »" ]
]
]
else text ""