aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/elm/LoggedIn/Stat/View.elm34
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
+ ]
+ ]