diff options
| author | zorun <github@bitsofnetworks.org> | 2020-05-04 23:06:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-04 23:06:35 +0200 |
| commit | 795efd6b58a0d4eec002eddeb4c9b0b16461a4a0 (patch) | |
| tree | 66c051e35599f15610442bb239e4dd6132db765d /ihatemoney/templates | |
| parent | 15ab04e636f1c267da3ef1c6bd4cdc68449b2e97 (diff) | |
| download | ihatemoney-mirror-795efd6b58a0d4eec002eddeb4c9b0b16461a4a0.zip ihatemoney-mirror-795efd6b58a0d4eec002eddeb4c9b0b16461a4a0.tar.gz ihatemoney-mirror-795efd6b58a0d4eec002eddeb4c9b0b16461a4a0.tar.bz2 | |
Fix order of participants in the statistics page (#608)
This fixes #607 and add a test case for this bug.
It also renames participants in test cases to avoid alphabetical ordering.
Inserting participants in alphabetical order is a special case, because ordering by ID will be the same as ordering by name. This is a bad idea in test cases, as #607 has shown.
Diffstat (limited to 'ihatemoney/templates')
| -rw-r--r-- | ihatemoney/templates/statistics.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ihatemoney/templates/statistics.html b/ihatemoney/templates/statistics.html index 7321188..b38abb1 100644 --- a/ihatemoney/templates/statistics.html +++ b/ihatemoney/templates/statistics.html @@ -9,7 +9,7 @@ <th class="balance-value">{{ _("Balance") }}</th> </tr> </thead> - {% for stat in members_stats| sort(attribute='member.name') %} + {% for stat in members_stats|sort(attribute='member.name') %} <tr> <td class="balance-name">{{ stat.member.name }}</td> <td class="balance-value {% if stat.balance|round(2) > 0 %}positive{% elif stat.balance|round(2) < 0 %}negative{% endif %}"> @@ -27,7 +27,7 @@ <table id="bill_table" class="split_bills table table-striped ml-md-n3"> <thead><tr><th class="d-md-none">{{ _("Who?") }}</th><th>{{ _("Paid") }}</th><th>{{ _("Spent") }}</th></tr></thead> <tbody> - {% for stat in members_stats %} + {% for stat in members_stats|sort(attribute='member.name') %} <tr> <td class="d-md-none">{{ stat.member.name }}</td> <td>{{ "%0.2f"|format(stat.paid) }}</td> |
