aboutsummaryrefslogtreecommitdiff
path: root/src/client/Model/View
diff options
context:
space:
mode:
authorJoris2015-09-06 00:05:50 +0200
committerJoris2015-09-06 00:05:50 +0200
commit24633871359ec9fbd63fdfebf79a6351b2792f77 (patch)
treea87c8a964a3c5114da13e622c604cf99ab905a06 /src/client/Model/View
parent8c328987901973cd0ffd2e03cae547717ebbbc67 (diff)
Can add monthly payments, not visible at the moment though, just the count is printed
Diffstat (limited to 'src/client/Model/View')
-rw-r--r--src/client/Model/View/LoggedView.elm8
-rw-r--r--src/client/Model/View/Payment/Add.elm6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/client/Model/View/LoggedView.elm b/src/client/Model/View/LoggedView.elm
index 35fd9e5..34a55a2 100644
--- a/src/client/Model/View/LoggedView.elm
+++ b/src/client/Model/View/LoggedView.elm
@@ -13,6 +13,7 @@ type alias LoggedView =
{ users : Users
, me : UserId
, add : AddPayment
+ , monthlyPayments : Payments
, payments : Payments
, paymentsCount : Int
, payers : Payers
@@ -20,11 +21,12 @@ type alias LoggedView =
, currentPage : Int
}
-initLoggedView : Users -> UserId -> Payments -> Int -> Payers -> LoggedView
-initLoggedView users me payments paymentsCount payers =
+initLoggedView : Users -> UserId -> Payments -> Payments -> Int -> Payers -> LoggedView
+initLoggedView users me monthlyPayments payments paymentsCount payers =
{ users = users
, me = me
- , add = initAddPayment
+ , add = initAddPayment Punctual
+ , monthlyPayments = monthlyPayments
, payments = payments
, paymentsCount = paymentsCount
, payers = payers
diff --git a/src/client/Model/View/Payment/Add.elm b/src/client/Model/View/Payment/Add.elm
index da5d0f2..dc00e86 100644
--- a/src/client/Model/View/Payment/Add.elm
+++ b/src/client/Model/View/Payment/Add.elm
@@ -20,13 +20,13 @@ type alias AddPayment =
, frequency : Frequency
}
-initAddPayment : AddPayment
-initAddPayment =
+initAddPayment : Frequency -> AddPayment
+initAddPayment frequency =
{ name = ""
, nameError = Nothing
, cost = ""
, costError = Nothing
- , frequency = Punctual
+ , frequency = frequency
}
validateName : String -> Translations -> Result String String