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