From 54ce277db52d4a2f5170bee5bbd9e011112c6582 Mon Sep 17 00:00:00 2001 From: Adrien CLERC Date: Sat, 7 Sep 2019 00:25:36 +0200 Subject: Add more human "for who?" description. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The limit for displaying "Everyone but …" instead of the ower's list is completely empirical. --- ihatemoney/templates/list_bills.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ihatemoney/templates/list_bills.html') diff --git a/ihatemoney/templates/list_bills.html b/ihatemoney/templates/list_bills.html index e42ec37..dddef4d 100644 --- a/ihatemoney/templates/list_bills.html +++ b/ihatemoney/templates/list_bills.html @@ -123,7 +123,13 @@ {{ bill.payer }} {{ bill.what }} - {{ bill.owers|join(', ', 'name') }} + {% if bill.owers|length == g.project.members|length -%} + {{ _("Everyone") }} + {%- elif bill.owers|length > g.project.members|length / 2 + 1 -%} + {{ _("Everyone but %(excluded)s", excluded=g.project.members|reject('in', bill.owers)|join(', ', 'name')) }} + {%- else -%} + {{ bill.owers|join(', ', 'name') }} + {%- endif %} {{ "%0.2f"|format(bill.amount) }} ({{ "%0.2f"|format(bill.pay_each()) }} {{ _("each") }}) {{ _('edit') }} -- cgit v1.1