From f02c7462f3883151df62c035aada13cc946dd43a Mon Sep 17 00:00:00 2001 From: Paul Brinkmeier Date: Sun, 11 Dec 2022 01:24:23 +0100 Subject: [PATCH] Add title --- elm/Main.elm | 9 ++++----- static/index.html | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/elm/Main.elm b/elm/Main.elm index f089fa6..e7ab596 100644 --- a/elm/Main.elm +++ b/elm/Main.elm @@ -17,11 +17,11 @@ import Json.Decode.Pipeline exposing (..) import Json.Encode as Enc import Set exposing (Set) -main = Browser.element +main = Browser.document { init = \() -> init , subscriptions = \_ -> Sub.none , update = update - , view = view + , view = \outerState -> { title = "jon", body = [ view outerState ] } } getOverviewItems : Int -> Cmd Msg @@ -263,7 +263,7 @@ view outerState = case outerState of viewState global state = case state of Overview { selectedItems, desiredInventory, overviewItems } -> let - header = tableCells th <| List.map text [ "", "ID", "Artikel", "Barcode", "Preis", "Kaufdatum", "Snackeinträge", "Soll-Inv.", "Ist-Inv.", "Aktionen" ] + header = tableCells th <| List.map text [ "", "ID", "Artikel", "Barcode", "Preis", "Kaufdatum", "Snackeinträge", "Inventar", "Aktionen" ] viewOverviewItem oi = let adjustedInventory = Maybe.withDefault oi.unitsLeft <| Dict.get oi.id desiredInventory @@ -296,14 +296,13 @@ viewState global state = case state of , text <| showEuros oi.price , text <| Tuple.first <| splitAt 'T' oi.bought , text <| String.fromInt oi.activeMappings - , text <| String.fromInt oi.unitsLeft , input [ type_ "number" , onInput <| SetDesiredInventory oi.id , value <| String.fromInt adjustedInventory , style "width" "5em" ] [] - , span [] + , div [] [ button (if adjustedInventory == oi.unitsLeft then [ disabled True ] diff --git a/static/index.html b/static/index.html index d3fd93d..c43404d 100644 --- a/static/index.html +++ b/static/index.html @@ -5,11 +5,10 @@ -