Add more human "for who?" description.

The limit for displaying "Everyone except …"
instead of the ower's list is completely empirical.
This commit is contained in:
Adrien CLERC 2018-05-09 22:06:32 +02:00
parent c3b2af3df3
commit 83297098de

View file

@ -105,7 +105,13 @@
<td>{{ bill.date }}</td>
<td>{{ bill.payer }}</td>
<td>{{ bill.what }}</td>
<td>{{ bill.owers|join(', ', 'name') }} </td>
<td>{% if bill.owers|length == g.project.members|length -%}
{{ _("Everyone") }}
{%- elif bill.owers|length > g.project.members|length / 2 + 1 -%}
{{ _("Everyone excepted %(excluded)s", excluded=g.project.members|reject('in', bill.owers)|join(', ', 'name')) }}
{%- else -%}
{{ bill.owers|join(', ', 'name') }}
{%- endif %}</td>
<td>{{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }})</td>
<td class="bill-actions">
<a class="edit" href="{{ url_for(".edit_bill", bill_id=bill.id) }}" title="{{ _("edit") }}">{{ _('edit') }}</a>