From: Christian Heller Date: Tue, 28 Jan 2025 12:03:28 +0000 (+0100) Subject: Improve /balance layout. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/todos?a=commitdiff_plain;h=67bfe97dfe2ce86bb4c0ce6504ed438379f25a6d;p=plomledger Improve /balance layout. --- diff --git a/templates/balance.tmpl b/templates/balance.tmpl index 6110654..14878c9 100644 --- a/templates/balance.tmpl +++ b/templates/balance.tmpl @@ -1,28 +1,30 @@ {% extends '_base.tmpl' %} +{% macro tr_money(amt, curr) %} + +{{amt}} +{{curr|truncate(4,true,"…")}} + +{% endmacro %} + + {% macro account_with_children(account, indent) %} {% if account.wealth.moneys|length == 1 %} {% for curr, amt in account.wealth.moneys.items() %} - - - - + {{ tr_money(amt, curr) }} {% endfor %}
{{amt}}{{curr|truncate(4,true,"…")}}
{% else %}
- +
{% for curr, amt in account.wealth.moneys.items() %} {% if 1 == loop.index %} - - - - + {{ tr_money(amt, curr) }} {% endif %} {% endfor %}
{{amt}}{{curr|truncate(4,true,"…")}}
@@ -30,17 +32,14 @@ {% for curr, amt in account.wealth.moneys.items() %} {% if 1 < loop.index %} - - - - + {{ tr_money(amt, curr) }} {% endif %} {% endfor %}
{{amt}}{{curr|truncate(4,true,"…")}}
{% endif %} - {% for i in range(indent) %}        {% endfor %}{% if account.parent %}:{% endif %}{{account.basename}}{% if account.children %}:{% endif %} + {% for i in range(indent) %} {% endfor %}{% if account.parent %}:{% endif %}{{account.basename}}{% if account.children %}:{% endif %} {% for child in account.children %} {{ account_with_children(child, indent=indent+1) }} @@ -50,10 +49,16 @@ {% 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 %}