mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00

Clearer data structure, and simpler template This commit has a side effect: sidebar now hides disabled members. IMHO, the disabled members should either be hidden or shown consistently between sidebar and central table. Previous status was: shown in sidebar (if balance ≠ 0) and hidden in central table.
34 lines
1.1 KiB
HTML
34 lines
1.1 KiB
HTML
{% extends "sidebar_table_layout.html" %}
|
|
|
|
{% block sidebar %}
|
|
<div id="table_overflow">
|
|
<table class="balance table">
|
|
{% 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 %}">
|
|
{% if stat.balance|round(2) > 0 %}+{% endif %}{{ "%.2f" | format(stat.balance) }}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
|
|
{% block content %}
|
|
<table id="bill_table" class="split_bills table table-striped">
|
|
<thead><tr><th>{{ _("Who?") }}</th><th>{{ _("Paid") }}</th><th>{{ _("Spent") }}</th><th>{{ _("Balance") }}</th></tr></thead>
|
|
<tbody>
|
|
{% for stat in members_stats %}
|
|
<tr>
|
|
<td>{{ stat.member.name }}</td>
|
|
<td>{{ "%0.2f"|format(stat.paid) }}</td>
|
|
<td>{{ "%0.2f"|format(stat.spent) }}</td>
|
|
<td>{{ "%0.2f"|format(stat.balance) }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
{% endblock %}
|