From e10531ba4e60c8709088798763ae3bae6608f9c9 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 6 Sep 2015 12:39:03 +0200 Subject: Show montly payments with an expandable mechanism --- src/client/Model/Payment.elm | 1 + src/client/Model/View/LoggedView.elm | 9 +++++---- src/client/Model/View/Payment/Monthly.elm | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 src/client/Model/View/Payment/Monthly.elm (limited to 'src/client/Model') diff --git a/src/client/Model/Payment.elm b/src/client/Model/Payment.elm index 313c6be..1f1c4ed 100644 --- a/src/client/Model/Payment.elm +++ b/src/client/Model/Payment.elm @@ -4,6 +4,7 @@ module Model.Payment , Payment , PaymentId , paymentsDecoder + , paymentIdDecoder ) where import Date exposing (..) diff --git a/src/client/Model/View/LoggedView.elm b/src/client/Model/View/LoggedView.elm index 34a55a2..264fdf5 100644 --- a/src/client/Model/View/LoggedView.elm +++ b/src/client/Model/View/LoggedView.elm @@ -8,16 +8,17 @@ import Model.Payment exposing (Payments) import Model.Payers exposing (Payers) import Model.View.Payment.Add exposing (..) import Model.View.Payment.Edition exposing (..) +import Model.View.Payment.Monthly exposing (..) type alias LoggedView = { users : Users , me : UserId , add : AddPayment - , monthlyPayments : Payments + , monthly : Monthly , payments : Payments , paymentsCount : Int , payers : Payers - , edition : Maybe Edition + , paymentEdition : Maybe Edition , currentPage : Int } @@ -26,10 +27,10 @@ initLoggedView users me monthlyPayments payments paymentsCount payers = { users = users , me = me , add = initAddPayment Punctual - , monthlyPayments = monthlyPayments + , monthly = initMonthly monthlyPayments , payments = payments , paymentsCount = paymentsCount , payers = payers - , edition = Nothing + , paymentEdition = Nothing , currentPage = 1 } diff --git a/src/client/Model/View/Payment/Monthly.elm b/src/client/Model/View/Payment/Monthly.elm new file mode 100644 index 0000000..15a5f2e --- /dev/null +++ b/src/client/Model/View/Payment/Monthly.elm @@ -0,0 +1,17 @@ +module Model.View.Payment.Monthly + ( Monthly + , initMonthly + ) where + +import Model.Payment exposing (Payments) + +type alias Monthly = + { payments : Payments + , visibleDetail : Bool + } + +initMonthly : Payments -> Monthly +initMonthly payments = + { payments = payments + , visibleDetail = False + } -- cgit v1.2.3