From: Christian Heller Date: Thu, 13 Feb 2025 02:20:58 +0000 (+0100) Subject: In Booking balance view, highlight accounts directly targeted in Booking. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdb.prefix%7D%7D/todos?a=commitdiff_plain;h=25c4a42e37a2fd71ca14c78d5e4d8c854677a89a;p=ledgplom In Booking balance view, highlight accounts directly targeted in Booking. --- diff --git a/src/run.py b/src/run.py index bafb5bb..351e1fa 100755 --- a/src/run.py +++ b/src/run.py @@ -483,6 +483,7 @@ class Handler(PlomHttpHandler): wealth.purge_currencies_except(displayed_currencies) node: dict[str, Any] = { 'name': path, + 'directly_set': directly_set, 'wealth_before': wealth_before.moneys, 'wealth_diff': diff, 'wealth_after': wealth_after.moneys, diff --git a/src/templates/_macros.tmpl b/src/templates/_macros.tmpl index c93ceb9..f5d7943 100644 --- a/src/templates/_macros.tmpl +++ b/src/templates/_macros.tmpl @@ -121,33 +121,33 @@ function taint() { {% endmacro %} -{% macro booking_balance_account_with_children(account) %} - -{{account.name}}{% if account.children %}:{% endif %} +{% macro booking_balance_account_with_children(node) %} + +{{node.name}}{% if node.children %}:{% endif %} -{% for curr, amt in account.wealth_before.items() %} +{% for curr, amt in node.wealth_before.items() %} {{ tr_money_balance(amt, curr) }} {% endfor %}
-{% for curr, amt in account.wealth_diff.items() %} +{% for curr, amt in node.wealth_diff.items() %} {{ tr_money_balance(amt, curr) }} {% endfor %}
-{% for curr, amt in account.wealth_after.items() %} +{% for curr, amt in node.wealth_after.items() %} {{ tr_money_balance(amt, curr) }} {% endfor %}
-{% for child in account.children %} +{% for child in node.children %} {{ booking_balance_account_with_children(child) }} {% endfor %} {% endmacro %} diff --git a/src/templates/edit_structured.tmpl b/src/templates/edit_structured.tmpl index 8569dea..ba99349 100644 --- a/src/templates/edit_structured.tmpl +++ b/src/templates/edit_structured.tmpl @@ -8,6 +8,7 @@ input.date_input, input.number_input { font-family: monospace; } input.number_input { text-align: right; } input.date_input { margin-right: 0.1em; } +tr.directly_set > td { font-weight: bold; } {% endblock %}