aboutsummaryrefslogtreecommitdiff
path: root/src/client/View/Payments
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/View/Payments')
-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) ]
+ ]