aboutsummaryrefslogtreecommitdiff
path: root/src/client/View
diff options
context:
space:
mode:
authorJoris2015-09-05 19:03:12 +0200
committerJoris2015-09-05 19:03:12 +0200
commiteb5ecba59887a5d1e74bf6287fabdf8a2979f44c (patch)
tree0e3b61002173fb012ad9ddae18632d391330cb50 /src/client/View
parentcc6a51b5ca03ee1a3b5de7c32dd1324e1053f42a (diff)
Payment frequence choice between either punctual or monthly, UI only
Diffstat (limited to 'src/client/View')
-rw-r--r--src/client/View/Payments/Add.elm15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client/View/Payments/Add.elm b/src/client/View/Payments/Add.elm
index 77d40ea..085b16d 100644
--- a/src/client/View/Payments/Add.elm
+++ b/src/client/View/Payments/Add.elm
@@ -37,6 +37,7 @@ addPayment model loggedView =
]
[ addPaymentName loggedView.add
, addPaymentCost model loggedView.add
+ , paymentFrequency model loggedView.add
, button
[ type' "submit" ]
[ text (getMessage "Add" model.translations)]
@@ -83,3 +84,17 @@ addPaymentCost model addPayment =
Nothing ->
text ""
]
+
+paymentFrequency : Model -> AddPayment -> Html
+paymentFrequency model addPayment =
+ div
+ [ class "frequency"
+ , onClick actions.address (UpdatePayment << UpdateAdd <| ToggleFrequency)
+ ]
+ [ div
+ [ class ("punctual" ++ if addPayment.frequency == Punctual then " selected" else "") ]
+ [ text (getMessage "Punctual" model.translations) ]
+ , div
+ [ class ("monthly" ++ if addPayment.frequency == Monthly then " selected" else "") ]
+ [ text (getMessage "Monthly" model.translations) ]
+ ]