Add title

This commit is contained in:
Paul Brinkmeier 2022-12-11 01:24:23 +01:00
parent 05724dbaab
commit f02c7462f3
2 changed files with 5 additions and 7 deletions

View File

@ -17,11 +17,11 @@ import Json.Decode.Pipeline exposing (..)
import Json.Encode as Enc import Json.Encode as Enc
import Set exposing (Set) import Set exposing (Set)
main = Browser.element main = Browser.document
{ init = \() -> init { init = \() -> init
, subscriptions = \_ -> Sub.none , subscriptions = \_ -> Sub.none
, update = update , update = update
, view = view , view = \outerState -> { title = "jon", body = [ view outerState ] }
} }
getOverviewItems : Int -> Cmd Msg getOverviewItems : Int -> Cmd Msg
@ -263,7 +263,7 @@ view outerState = case outerState of
viewState global state = case state of viewState global state = case state of
Overview { selectedItems, desiredInventory, overviewItems } -> Overview { selectedItems, desiredInventory, overviewItems } ->
let 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 = viewOverviewItem oi =
let let
adjustedInventory = Maybe.withDefault oi.unitsLeft <| Dict.get oi.id desiredInventory 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 <| showEuros oi.price
, text <| Tuple.first <| splitAt 'T' oi.bought , text <| Tuple.first <| splitAt 'T' oi.bought
, text <| String.fromInt oi.activeMappings , text <| String.fromInt oi.activeMappings
, text <| String.fromInt oi.unitsLeft
, input , input
[ type_ "number" [ type_ "number"
, onInput <| SetDesiredInventory oi.id , onInput <| SetDesiredInventory oi.id
, value <| String.fromInt adjustedInventory , value <| String.fromInt adjustedInventory
, style "width" "5em" , style "width" "5em"
] [] ] []
, span [] , div []
[ button [ button
(if adjustedInventory == oi.unitsLeft (if adjustedInventory == oi.unitsLeft
then [ disabled True ] then [ disabled True ]

View File

@ -5,11 +5,10 @@
<link rel="stylesheet" href="./jon.css"> <link rel="stylesheet" href="./jon.css">
</head> </head>
<body> <body>
<div class="jon-elm"></div>
<!-- Compiled by Elm --> <!-- Compiled by Elm -->
<script src="./jon.js"></script> <script src="./jon.js"></script>
<script> <script>
Elm.Main.init({ node: document.querySelector('.jon-elm') }); Elm.Main.init();
</script> </script>
</body> </body>
</html> </html>