diff options
author | Joris | 2017-03-27 10:18:40 +0200 |
---|---|---|
committer | Joris | 2017-03-27 10:18:40 +0200 |
commit | 64ff4707fdcd81c27c6be9903c3c82bc543ef016 (patch) | |
tree | fa0c3a9112f4f7c8bd383ad3e597041ab7d5a503 /src/client/LoggedIn/Home/View.elm | |
parent | 40273c30166877b3341125ad5248793b2f2fcc64 (diff) |
Modelize punctual and monthly payment pages
Diffstat (limited to 'src/client/LoggedIn/Home/View.elm')
-rw-r--r-- | src/client/LoggedIn/Home/View.elm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/LoggedIn/Home/View.elm b/src/client/LoggedIn/Home/View.elm index 0b90e67..fba3f7c 100644 --- a/src/client/LoggedIn/Home/View.elm +++ b/src/client/LoggedIn/Home/View.elm @@ -16,7 +16,8 @@ import LoggedIn.Home.Msg as HomeMsg import LoggedIn.Home.View.Paging as Paging import LoggedIn.Home.View.Table as Table import LoggedIn.Msg as LoggedInMsg -import Model.Payment as Payment exposing (Frequency(..)) +import Model.Payment as Payment +import Model.Frequency exposing (Frequency(..)) import Msg exposing (Msg) view : LoggedData -> Home.Model -> Html Msg @@ -26,12 +27,16 @@ view loggedData home = Just data -> (Maybe.withDefault "" data.name, data.frequency) Nothing -> ("", Punctual) payments = Payment.search name frequency loggedData.payments + page = + case frequency of + Punctual -> home.punctualPage + Monthly -> home.monthlyPage in div [ class "home" ] [ Header.view loggedData home payments frequency - , Table.view loggedData home payments frequency + , Table.view loggedData home payments frequency page , Paging.view - home.currentPage + page (List.length payments) Msg.NoOp (Msg.UpdateLoggedIn << LoggedInMsg.HomeMsg << HomeMsg.UpdatePage) |