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)