diff options
Diffstat (limited to 'ihatemoney/templates')
| -rw-r--r-- | ihatemoney/templates/forms.html | 2 | ||||
| -rw-r--r-- | ihatemoney/templates/list_bills.html | 19 |
2 files changed, 9 insertions, 12 deletions
diff --git a/ihatemoney/templates/forms.html b/ihatemoney/templates/forms.html index 0900d2f..82b960e 100644 --- a/ihatemoney/templates/forms.html +++ b/ihatemoney/templates/forms.html @@ -124,7 +124,7 @@ {{ input(form.what, inline=True) }} {{ input(form.payer, inline=True, class="form-control custom-select") }} {{ input(form.amount, inline=True) }} - {% if not form.original_currency.render_kw %} + {% if g.project.default_currency != "XXX" %} {{ input(form.original_currency, inline=True) }} {% endif %} {{ input(form.external_link, inline=True) }} 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 @@ </th><th>{{ _("For what?") }} </th><th>{{ _("For whom?") }} </th><th>{{ _("How much?") }} - {% if g.project.default_currency != "No Currency" %} - </th><th>{{ _("Amount in %(currency)s", currency=g.project.default_currency) }} - {%- else -%} - </th><th>{{ _("Amount") }} - {% endif %} </th><th>{{ _("Actions") }}</th></tr> </thead> <tbody> @@ -149,13 +148,11 @@ {{ bill.owers|join(', ', 'name') }} {%- endif %}</td> <td> - {% 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 %} + <span data-toggle="tooltip" data-placement="top" + title="{{ bill_amount(bill, g.project.default_currency, bill.converted_amount) if bill.original_currency != g.project.default_currency else '' }}"> + {{ bill_amount(bill) }} + </span> </td> - <td>{{ "%0.2f"|format(bill.converted_amount) }}</td> <td class="bill-actions"> <a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}">{{ _('edit') }}</a> <a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}">{{ _('delete') }}</a> |
