From 981edd413acfdd4786faf5439d2a05d6d7e4649e Mon Sep 17 00:00:00 2001 From: Glandos Date: Thu, 7 May 2020 22:56:17 +0200 Subject: Improve currencies (#604) - Rename "No Currency" to ISO4217 "XXX" - Use Babel to render currency symbols and names in currency lists - Improve i18n in bill lists Fix #601 Fix #600 --- ihatemoney/templates/list_bills.html | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'ihatemoney/templates/list_bills.html') diff --git a/ihatemoney/templates/list_bills.html b/ihatemoney/templates/list_bills.html index be55c19..7ae3bd6 100644 --- a/ihatemoney/templates/list_bills.html +++ b/ihatemoney/templates/list_bills.html @@ -1,5 +1,9 @@ {% extends "sidebar_table_layout.html" %} +{%- macro bill_amount(bill, currency=bill.original_currency, amount=bill.amount) %} + {{ amount|currencyformat_nc(currency) }} ({{ _("%(amount)s each", amount=bill.pay_each_default(amount)|currencyformat_nc(currency)) }}) +{% endmacro -%} + {% block title %} - {{ g.project.name }}{% endblock %} {% block js %} {% if add_bill %} $('#new-bill > a').click(); {% endif %} @@ -123,11 +127,6 @@ {{ _("For what?") }} {{ _("For whom?") }} {{ _("How much?") }} - {% if g.project.default_currency != "No Currency" %} - {{ _("Amount in %(currency)s", currency=g.project.default_currency) }} - {%- else -%} - {{ _("Amount") }} - {% endif %} {{ _("Actions") }} @@ -149,13 +148,11 @@ {{ bill.owers|join(', ', 'name') }} {%- endif %} - {% if bill.original_currency != "No Currency" %} - {{ "%0.2f"|format(bill.amount) }} {{bill.original_currency}} ({{ "%0.2f"|format(bill.pay_each_default(bill.amount)) }} {{bill.original_currency}} {{ _(" each") }}) - {%- else -%} - {{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each_default(bill.amount)) }} {{ _(" each") }}) - {% endif %} + + {{ bill_amount(bill) }} + - {{ "%0.2f"|format(bill.converted_amount) }} {{ _('edit') }} {{ _('delete') }} -- cgit v1.1