diff options
author | Joris | 2016-04-05 13:39:48 +0200 |
---|---|---|
committer | Joris | 2016-04-05 13:39:48 +0200 |
commit | edca79a7e2bfed1a08de780cc6ab7eac430ef950 (patch) | |
tree | 02f794910924f1ca0114d08a254deed98388c70f /src/client/elm/View | |
parent | d19b69eeeb0c24ee7e4a75b0da32eefba1d43928 (diff) |
Add a statistics empty page
Diffstat (limited to 'src/client/elm/View')
-rw-r--r-- | src/client/elm/View/Header.elm | 53 |
1 files changed, 28 insertions, 25 deletions
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 + ] + ] + _ -> + [] + ) |