From 24633871359ec9fbd63fdfebf79a6351b2792f77 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 6 Sep 2015 00:05:50 +0200 Subject: Can add monthly payments, not visible at the moment though, just the count is printed --- src/client/View/Payments/Monthly.elm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/client/View/Payments/Monthly.elm (limited to 'src/client/View/Payments/Monthly.elm') diff --git a/src/client/View/Payments/Monthly.elm b/src/client/View/Payments/Monthly.elm new file mode 100644 index 0000000..366af92 --- /dev/null +++ b/src/client/View/Payments/Monthly.elm @@ -0,0 +1,24 @@ +module View.Payments.Monthly + ( monthlyPayments + ) where + +import Html exposing (..) +import Html.Attributes exposing (..) +import Html.Events exposing (..) + +import Model exposing (Model) +import Model.Payment exposing (Payments) +import Model.View.LoggedView exposing (LoggedView) +import Model.Translations exposing (getVarMessage) + +monthlyPayments : Model -> LoggedView -> Html +monthlyPayments model loggedView = + div + [ class "monthlyPayments" ] + [ monthlyCount model loggedView.monthlyPayments ] + +monthlyCount : Model -> Payments -> Html +monthlyCount model monthlyPayments = + let count = List.length monthlyPayments + key = if count > 1 then "PluralMonthlyCount" else "SingularMonthlyCount" + in text (getVarMessage [toString count] key model.translations) -- cgit v1.2.3