diff options
author | Joris | 2015-12-31 19:34:29 +0100 |
---|---|---|
committer | Joris | 2015-12-31 19:34:29 +0100 |
commit | b73ba24f3440b81698c9d5c370739d03f958f059 (patch) | |
tree | 72caa19d605d9e9af2d43a6f62c177ddb3d0f3b3 /src/client/elm/View/LoggedIn | |
parent | 5bfd349bedb9c395cbeb38bb888e379ba36d5d35 (diff) |
Fetch all the payments, do the paging only in the UI
Diffstat (limited to 'src/client/elm/View/LoggedIn')
-rw-r--r-- | src/client/elm/View/LoggedIn/Paging.elm | 14 | ||||
-rw-r--r-- | src/client/elm/View/LoggedIn/Table.elm | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/client/elm/View/LoggedIn/Paging.elm b/src/client/elm/View/LoggedIn/Paging.elm index 608113b..e40c5aa 100644 --- a/src/client/elm/View/LoggedIn/Paging.elm +++ b/src/client/elm/View/LoggedIn/Paging.elm @@ -9,8 +9,6 @@ import Html.Events exposing (..) import Model.View.LoggedInView exposing (..) import Model.Payment exposing (perPage) -import ServerCommunication as SC exposing (serverCommunications) - import Update exposing (..) import Update.LoggedIn exposing (..) @@ -58,7 +56,7 @@ firstPage : Html firstPage = button [ class "page" - , onClick serverCommunications.address (SC.UpdatePage 1) + , onClick actions.address (UpdateLoggedIn (UpdatePage 1)) ] [ renderIcon "fast-backward" ] @@ -66,7 +64,7 @@ previousPage : LoggedInView -> Html previousPage loggedInView = button [ class "page" - , onClick serverCommunications.address (SC.UpdatePage (loggedInView.currentPage - 1)) + , onClick actions.address (UpdateLoggedIn (UpdatePage (loggedInView.currentPage - 1))) ] [ renderIcon "backward" ] @@ -74,7 +72,7 @@ nextPage : LoggedInView -> Html nextPage loggedInView = button [ class "page" - , onClick serverCommunications.address (SC.UpdatePage (loggedInView.currentPage + 1)) + , onClick actions.address (UpdateLoggedIn (UpdatePage (loggedInView.currentPage + 1))) ] [ renderIcon "forward" ] @@ -82,7 +80,7 @@ lastPage : Int -> Html lastPage maxPage = button [ class "page" - , onClick serverCommunications.address (SC.UpdatePage maxPage) + , onClick actions.address (UpdateLoggedIn (UpdatePage maxPage)) ] [ renderIcon "fast-forward" ] @@ -94,7 +92,7 @@ paymentsPage loggedInView page = [ ("page", True) , ("current", onCurrentPage) ] - , onClick serverCommunications.address <| - if onCurrentPage then SC.NoCommunication else SC.UpdatePage page + , onClick actions.address <| + if onCurrentPage then NoOp else UpdateLoggedIn (UpdatePage page) ] [ text (toString page) ] diff --git a/src/client/elm/View/LoggedIn/Table.elm b/src/client/elm/View/LoggedIn/Table.elm index f5a08b5..51a7b73 100644 --- a/src/client/elm/View/LoggedIn/Table.elm +++ b/src/client/elm/View/LoggedIn/Table.elm @@ -49,6 +49,8 @@ paymentLines model loggedInView = loggedInView.payments |> List.sortBy (Date.toTime << .creation) |> List.reverse + |> List.drop ((loggedInView.currentPage - 1) * perPage) + |> List.take perPage |> List.map (paymentLine model loggedInView) paymentLine : Model -> LoggedInView -> Payment -> Html |