blob: 366af92ef024b8c185b44cb5e67acecb5f5e19cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)
|