diff --git a/ihatemoney/templates/list_bills.html b/ihatemoney/templates/list_bills.html index 2369477d..88da9973 100644 --- a/ihatemoney/templates/list_bills.html +++ b/ihatemoney/templates/list_bills.html @@ -1,5 +1,10 @@ {% extends "sidebar_table_layout.html" %} +{%- macro bill_amount(bill, currency=bill.original_currency, amount=bill.amount) %} + {# Undocumented currencyformat filter from flask_babel is forwarding to Babel format_currency #} + {{ amount|currencyformat(currency if currency != 'XXX' else '') }} ({{ _("%(amount)s each", amount=bill.pay_each_default(amount)|currencyformat(currency if currency != 'XXX' else '')) }}) +{% endmacro -%} + {% block title %} - {{ g.project.name }}{% endblock %} {% block js %} {% if add_bill %} $('#new-bill > a').click(); {% endif %} @@ -117,11 +122,6 @@ {{ _("For what?") }} {{ _("For whom?") }} {{ _("How much?") }} - {% if g.project.default_currency != "XXX" %} - {{ _("Amount in %(currency)s", currency=g.project.default_currency) }} - {%- else -%} - {{ _("Amount") }} - {% endif %} {{ _("Actions") }} @@ -143,13 +143,11 @@ {{ bill.owers|join(', ', 'name') }} {%- endif %} - {% if bill.original_currency != "XXX" %} - {{ "%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') }}