diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/elm/LoggedIn/Stat/View.elm | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/client/elm/LoggedIn/Stat/View.elm b/src/client/elm/LoggedIn/Stat/View.elm index e5d1c08..76acd8f 100644 --- a/src/client/elm/LoggedIn/Stat/View.elm +++ b/src/client/elm/LoggedIn/Stat/View.elm @@ -6,5 +6,37 @@ import Html exposing (..) import LoggedData exposing (LoggedData) +import Model.Payment exposing (Payments) +import Model.Conf exposing (Conf) + +import LoggedIn.View.Price exposing (price) + view : LoggedData -> Html -view loggedData = text "Stats" +view loggedData = + div + [] + [ h1 [] [ text "Total" ] + , paymentDetail loggedData.conf loggedData.payments + ] + +paymentDetail : Conf -> Payments -> Html +paymentDetail conf payments = + ul + [] + [ li + [] + [ payments + |> List.length + |> toString + |> text + , text " payments" + ] + , li + [] + [ payments + |> List.map .cost + |> List.sum + |> price conf + |> text + ] + ] |