From c1f44a5890fbb26faf6f17c676662ea1bd495f2e Mon Sep 17 00:00:00 2001 From: Joris Date: Fri, 4 Sep 2015 09:52:20 +0200 Subject: Adding paging (need some fixes) --- src/client/Model/Payment.elm | 6 +++++- src/client/Model/View/PaymentView.elm | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/client/Model') diff --git a/src/client/Model/Payment.elm b/src/client/Model/Payment.elm index e773be3..02dcf7e 100644 --- a/src/client/Model/Payment.elm +++ b/src/client/Model/Payment.elm @@ -1,5 +1,6 @@ module Model.Payment - ( Payments + ( perPage + , Payments , Payment , PaymentId , PaymentWithId @@ -12,6 +13,9 @@ import Date exposing (..) import Json.Decode as Json exposing ((:=)) import Dict exposing (..) +perPage : Int +perPage = 10 + type alias Payments = Dict PaymentId Payment type alias PaymentWithId = (PaymentId, Payment) diff --git a/src/client/Model/View/PaymentView.elm b/src/client/Model/View/PaymentView.elm index 117be59..bf5804f 100644 --- a/src/client/Model/View/PaymentView.elm +++ b/src/client/Model/View/PaymentView.elm @@ -15,6 +15,7 @@ type alias PaymentView = , paymentsCount : Int , payers : Payers , edition : Maybe Edition + , currentPage : Int } initPaymentView : String -> Payments -> Int -> Payers -> PaymentView @@ -25,4 +26,5 @@ initPaymentView userName payments paymentsCount payers = , paymentsCount = paymentsCount , payers = payers , edition = Nothing + , currentPage = 1 } -- cgit v1.2.3