{% extends '_base.tmpl' %}
+{% macro tr_money(amt, curr) %}
+<tr>
+<td class="amt">{{amt}}</td>
+<td class="curr">{{curr|truncate(4,true,"…")}}</td>
+</tr>
+{% endmacro %}
+
+
{% macro account_with_children(account, indent) %}
<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>
+ {{ tr_money(amt, curr) }}
{% endfor %}
</table>
{% else %}
<details>
<summary>
- <table class="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>
+ {{ tr_money(amt, curr) }}
{% endif %}
{% endfor %}
</table>
<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>
+ {{ tr_money(amt, curr) }}
{% 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>
+ <td class="acc"><span class="indent">{% for i in range(indent) %} {% endfor %}</span>{% if account.parent %}:{% endif %}{{account.basename}}{% if account.children %}:{% endif %}</td>
</tr>
{% for child in account.children %}
{{ account_with_children(child, indent=indent+1) }}
{% block css %}
{{ macros.css_td_money() }}
+
+td.money table { float: left; }
td.amt { width: 10em; }
td.curr { width: 3em; }
-table.summary { float: left; }
-td.money { padding-right: 1em; }
+summary::marker { font-family: monospace; font-size: 1.2em; }
+summary { list-style-type: "[…]"; }
+details[open] > summary { list-style-type: "[^]"; }
+
+span.indent { letter-spacing: 3em; }
+
{% endblock css %}
{% block content %}