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 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 ]

View File

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