aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoris2015-09-06 19:29:07 +0200
committerJoris2015-09-06 19:29:07 +0200
commitdab9e42dae6e5287935e5dfc418fcb2adf036b9a (patch)
tree1caa783df89c38a3d527c259824da4709311620d /src
parent082faae086433440b76c533d1a5afd22e7baafe1 (diff)
downloadbudget-dab9e42dae6e5287935e5dfc418fcb2adf036b9a.tar.gz
budget-dab9e42dae6e5287935e5dfc418fcb2adf036b9a.tar.bz2
budget-dab9e42dae6e5287935e5dfc418fcb2adf036b9a.zip
Showing the total amount of monthly payments
Diffstat (limited to 'src')
-rw-r--r--src/client/View/LoggedIn/Monthly.elm3
-rw-r--r--src/server/Model/Message/Translations.hs10
2 files changed, 9 insertions, 4 deletions
diff --git a/src/client/View/LoggedIn/Monthly.elm b/src/client/View/LoggedIn/Monthly.elm
index 715288b..6d30e4a 100644
--- a/src/client/View/LoggedIn/Monthly.elm
+++ b/src/client/View/LoggedIn/Monthly.elm
@@ -38,12 +38,13 @@ monthlyPayments model loggedInView =
monthlyCount : Model -> Monthly -> Html
monthlyCount model monthly =
let count = List.length monthly.payments
+ total = List.sum << List.map .cost <| monthly.payments
key = if count > 1 then "PluralMonthlyCount" else "SingularMonthlyCount"
in button
[ class "count"
, onClick actions.address (UpdateLoggedIn << UpdateMonthly <| ToggleDetail)
]
- [ text (getParamMessage [toString count] key model.translations)
+ [ text (getParamMessage [toString count, toString total] key model.translations)
, div
[ class "expand" ]
[ if monthly.visibleDetail
diff --git a/src/server/Model/Message/Translations.hs b/src/server/Model/Message/Translations.hs
index 501f00f..0a1226a 100644
--- a/src/server/Model/Message/Translations.hs
+++ b/src/server/Model/Message/Translations.hs
@@ -216,6 +216,10 @@ m l SingularMonthlyCount =
French -> "Vous avez {1} paiement mensuel."
m l PluralMonthlyCount =
- case l of
- English -> "You have {1} monthly payments."
- French -> "Vous avez {1} paiements mensuels."
+ T.concat
+ [ case l of
+ English -> "You have {1} monthly payments with a total of {2} "
+ French -> "Vous avez {1} paiements mensuels d'une valeur totale de {2} "
+ , m l MoneySymbol
+ , "."
+ ]