summaryrefslogtreecommitdiff
path: root/elm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-11-19 16:33:29 +0100
committerYorhel <git@yorhel.nl>2019-11-19 16:33:31 +0100
commitcd1a04cdc4bf8c17ac9b69b47dba84862c3d89d0 (patch)
tree3310a57cc9a6a5295a8e10fb9b441abc400fdc28 /elm
parent559d6a191053a26b089c2f24946b58838f9b2cc9 (diff)
ulist: Compact the notes field and "add release" link in the expanded view
Less clutter when not editing.
Diffstat (limited to 'elm')
-rw-r--r--elm/UList/Opt.elm31
1 files changed, 20 insertions, 11 deletions
diff --git a/elm/UList/Opt.elm b/elm/UList/Opt.elm
index 5a8aaa1e..c1f488a0 100644
--- a/elm/UList/Opt.elm
+++ b/elm/UList/Opt.elm
@@ -161,19 +161,28 @@ view model =
opt =
[ tr []
[ td [ colspan 5 ]
- [ textarea ([ placeholder "Notes", rows 2, cols 80, onInput Notes, onBlur (NotesSave model.notesRev) ] ++ GVN.valNotes) [ text model.notes ]
- , div [ ]
- [ div [ class "spinner", classList [("invisible", model.notesState /= Api.Loading)] ] []
- , br [] []
- , case model.notesState of
- Api.Error e -> b [ class "standout" ] [ text <| Api.showResponse e ]
- _ -> text ""
- , br [] []
+ [ textarea (
+ [ placeholder "Notes", rows 2, cols 80
+ , onInput Notes, onBlur (NotesSave model.notesRev)
+ ] ++ GVN.valNotes
+ ) [ text model.notes ]
+ , div [ ] <|
+ [ div [ class "spinner", classList [("hidden", model.notesState /= Api.Loading)] ] []
, a [ href "#", onClickD (Del True) ] [ text "Remove VN" ]
- ]
+ ] ++ (
+ if model.relOptions == Nothing
+ then [ text " | ", a [ href "#", onClickD RelLoad ] [ text "Add release" ] ]
+ else []
+ ) ++ (
+ case model.notesState of
+ Api.Error e -> [ br [] [], b [ class "standout" ] [ text <| Api.showResponse e ] ]
+ _ -> []
+ )
]
]
- , tfoot []
+ , if model.relOptions == Nothing && model.relState == Api.Normal
+ then text ""
+ else tfoot []
[ tr []
[ td [ colspan 5 ] <|
-- TODO: This <select> solution is ugly as hell, a Lib.DropDown-based solution would be nicer.
@@ -181,7 +190,7 @@ view model =
case (model.relOptions, model.relState) of
(Just opts, _) -> [ inputSelect "" 0 RelAdd [ style "width" "500px" ]
<| (0, "-- add release --") :: List.filter (\(rid,_) -> not <| List.any (\r -> r.id == rid) model.rels) opts ]
- (_, Api.Normal) -> [ a [ href "#", onClickD RelLoad ] [ text "Add release" ] ]
+ (_, Api.Normal) -> []
(_, Api.Loading) -> [ span [ class "spinner" ] [], text "Loading releases..." ]
(_, Api.Error e) -> [ b [ class "standout" ] [ text <| Api.showResponse e ], text ". ", a [ href "#", onClickD RelLoad ] [ text "Try again" ] ]
]