</script>
<style>
body { background-color: white; font-family: sans-serif; }
-tr:nth-child(odd) { background-color: #dcdcdc; }
-tr:nth-child(even) { background-color: #ffffff; }
+tr.alternating:nth-child(odd) { background-color: #dcdcdc; }
+tr.alternating:nth-child(even) { background-color: #ffffff; }
td { text-align: left; vertical-align: top; }
span.warning, table.warning tbody tr td, tr.warning td { background-color: #ff8888; }
{% block css %}{% endblock %}
<table>
{% for dat_line in dat_lines %}
{% if (not raw) and dat_line.is_intro and loop.index > 1 %}
- <tr><td colspan=5> </td></tr>
+ <tr class="alternating"><td colspan=5> </td></tr>
{% endif %}
- <tr{% if dat_line.is_questionable %} class="warning"{% endif %}>
+ <tr class="alternating{% if dat_line.is_questionable %} warning{% endif %}">
{% if dat_line.is_intro %}
<td id="{{dat_line.booking_id}}"><a href="#{{dat_line.booking_id}}">#</a>/<a href="/balance?cutoff={{dat_line.booking_id+1}}">b</a></td>
{% else %}
{% endif %}
</tr>
{% if dat_line.error and not raw %}
- <tr class="warning">
+ <tr class="alternating warning">
<td></td>
<td class="invalid" colspan=3>{{dat_line.error}}</td>
<td></td>
{% extends '_base.tmpl' %}
+
{% macro account_with_children(account, indent) %}
- <tr>
- {% for curr, amt in account.wealth.moneys.items() %}
- {% if 1 == loop.index %}
- <td class="amt">{{amt}}</td>
- <td class="curr">{{curr|truncate(4,true,"…")}}</td>
- {% endif %}
- {% endfor %}
- <td>{{account.full_name}}{% if account.children %}:…{% endif %}</td>
- </tr>
- {% if account.wealth.moneys|length > 1 %}
- <tr>
- <td colspan=2>
- <details><summary>other currencies</summary>
- <table>
- {% for curr, amt in account.wealth.moneys.items() %}
- {% if 1 < loop.index %}
+ <tr class="alternating">
+ <td class="money">
+ {% if account.wealth.moneys|length == 1 %}
+ <table>
+ {% for curr, amt in account.wealth.moneys.items() %}
<tr>
<td class="amt">{{amt}}</td>
<td class="curr">{{curr|truncate(4,true,"…")}}</td>
</tr>
- {% endif %}
- {% endfor %}
- </table>
- </details>
- <td>
- </tr>
+ {% endfor %}
+ </table>
+ {% else %}
+ <details>
+ <summary>
+ <table class="summary">
+ {% for curr, amt in account.wealth.moneys.items() %}
+ {% if 1 == loop.index %}
+ <tr>
+ <td class="amt">{{amt}}</td>
+ <td class="curr">{{curr|truncate(4,true,"…")}}</td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ </table>
+ </summary>
+ <table>
+ {% for curr, amt in account.wealth.moneys.items() %}
+ {% if 1 < loop.index %}
+ <tr>
+ <td class="amt">{{amt}}</td>
+ <td class="curr">{{curr|truncate(4,true,"…")}}</td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ </table>
+ </details>
{% endif %}
+ </td>
+ <td class="acc">{% for i in range(indent) %} {% endfor %}{% if account.parent %}:{% endif %}{{account.basename}}{% if account.children %}:{% endif %}</td>
+ </tr>
{% for child in account.children %}
{{ account_with_children(child, indent=indent+1) }}
{% endfor %}
{% block css %}
{{ macros.css_td_money() }}
+td.amt { width: 10em; }
+td.curr { width: 3em; }
+table.summary { float: left; }
+td.money { padding-right: 1em; }
{% endblock css %}
{% block content %}