mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00
better i18n for "how much" column
fix #600 It also removes the "Amount in …" column by adding information as a tooltip if necessary
This commit is contained in:
parent
2e3c70edcd
commit
b4ee527ed5
1 changed files with 9 additions and 11 deletions
|
@ -1,5 +1,10 @@
|
||||||
{% extends "sidebar_table_layout.html" %}
|
{% 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 title %} - {{ g.project.name }}{% endblock %}
|
||||||
{% block js %}
|
{% block js %}
|
||||||
{% if add_bill %} $('#new-bill > a').click(); {% endif %}
|
{% if add_bill %} $('#new-bill > a').click(); {% endif %}
|
||||||
|
@ -117,11 +122,6 @@
|
||||||
</th><th>{{ _("For what?") }}
|
</th><th>{{ _("For what?") }}
|
||||||
</th><th>{{ _("For whom?") }}
|
</th><th>{{ _("For whom?") }}
|
||||||
</th><th>{{ _("How much?") }}
|
</th><th>{{ _("How much?") }}
|
||||||
{% if g.project.default_currency != "XXX" %}
|
|
||||||
</th><th>{{ _("Amount in %(currency)s", currency=g.project.default_currency) }}
|
|
||||||
{%- else -%}
|
|
||||||
</th><th>{{ _("Amount") }}
|
|
||||||
{% endif %}
|
|
||||||
</th><th>{{ _("Actions") }}</th></tr>
|
</th><th>{{ _("Actions") }}</th></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -143,13 +143,11 @@
|
||||||
{{ bill.owers|join(', ', 'name') }}
|
{{ bill.owers|join(', ', 'name') }}
|
||||||
{%- endif %}</td>
|
{%- endif %}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if bill.original_currency != "XXX" %}
|
<span data-toggle="tooltip" data-placement="top"
|
||||||
{{ "%0.2f"|format(bill.amount) }} {{bill.original_currency}} ({{ "%0.2f"|format(bill.pay_each_default(bill.amount)) }} {{bill.original_currency}} {{ _(" each") }})
|
title="{{ bill_amount(bill, g.project.default_currency, bill.converted_amount) if bill.original_currency != g.project.default_currency else '' }}">
|
||||||
{%- else -%}
|
{{ bill_amount(bill) }}
|
||||||
{{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each_default(bill.amount)) }} {{ _(" each") }})
|
</span>
|
||||||
{% endif %}
|
|
||||||
</td>
|
</td>
|
||||||
<td>{{ "%0.2f"|format(bill.converted_amount) }}</td>
|
|
||||||
<td class="bill-actions">
|
<td class="bill-actions">
|
||||||
<a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}">{{ _('edit') }}</a>
|
<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>
|
<a class="delete" href="{{ url_for(".delete_bill", bill_id=bill.id) }}" title="{{ _("delete") }}">{{ _('delete') }}</a>
|
||||||
|
|
Loading…
Reference in a new issue