diff options
Diffstat (limited to 'src/client/View/Payments/Monthly.elm')
-rw-r--r-- | src/client/View/Payments/Monthly.elm | 24 |
1 files changed, 24 insertions, 0 deletions
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) |