From edca79a7e2bfed1a08de780cc6ab7eac430ef950 Mon Sep 17 00:00:00 2001 From: Joris Date: Tue, 5 Apr 2016 13:39:48 +0200 Subject: Add a statistics empty page --- src/client/elm/View/Header.elm | 53 ++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'src/client/elm/View') diff --git a/src/client/elm/View/Header.elm b/src/client/elm/View/Header.elm index fb0e880..7a6fefc 100644 --- a/src/client/elm/View/Header.elm +++ b/src/client/elm/View/Header.elm @@ -21,28 +21,31 @@ import View.Click exposing (clickTo) renderHeader : Address Action -> Model -> Html renderHeader address model = - header - [] - [ a - ( [ class "title" ] ++ clickTo Home) - [ text (getMessage "SharedCost" model.translations) ] - , case model.view of - LoggedInView { me, users } -> - div - [ class "signedPanel" ] - [ a - ( [ class "user" ] ++ clickTo User) - [ Dict.get me users - |> Maybe.map .name - |> Maybe.withDefault "" - |> text - ] - , button - [ class "icon" - , onClick address SignOut - ] - [ renderIcon "power-off" ] - ] - _ -> - text "" - ] + let item route name additionalClasses = + a + ([ class ("item " ++ additionalClasses) ] ++ clickTo route) + [ text (getMessage name model.translations) ] + in + header + [] + ( [item Home "SharedCost" "title"] ++ + case model.view of + LoggedInView { me, users } -> + [ item Income "Income" "" + , item Stat "Statistics" "" + , button + [ class "signOut item" + , onClick address SignOut + ] + [ renderIcon "power-off" ] + , div + [ class "name" ] + [ Dict.get me users + |> Maybe.map .name + |> Maybe.withDefault "" + |> text + ] + ] + _ -> + [] + ) -- cgit v1.2.3