From: Christian Heller <c.heller@plomlompom.de> Date: Sun, 13 Oct 2024 05:13:22 +0000 (+0200) Subject: Add forgotten files. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/static/%7B%7Bdb.prefix%7D%7D/index.html?a=commitdiff_plain;p=misc Add forgotten files. --- diff --git a/ledger_templates/balance.html b/ledger_templates/balance.html new file mode 100644 index 0000000..abb34f5 --- /dev/null +++ b/ledger_templates/balance.html @@ -0,0 +1,22 @@ +{% extends "base.html" %} +{% block css %} +table { margin: 0; padding: 0; } +td.amount { text-align: right; padding-right: 1em; } +{% endblock %} +{% block content %} +<table> +{% for node in nodes %} +<tr> +<td class="amount">{% if 'â¬' in node.moneys.keys() %}{{ node.moneys['â¬']}}â¬{% endif %}</td> +<td style="padding-left: {{node.indent*2}}em;">{{node.name}}</td> +<td> +{% for currency, amount in node.moneys.items() %} +{% if currency != 'â¬' %} +{{amount}} {{currency}}{% if not loop.last %},{% endif %} +{% endif %} +{% endfor %} +</td> +</tr> +{% endfor %} +</table> +{% endblock %} diff --git a/ledger_templates/base.html b/ledger_templates/base.html new file mode 100644 index 0000000..bf6bdc2 --- /dev/null +++ b/ledger_templates/base.html @@ -0,0 +1,16 @@ +<style> +body { color: #000000; background-color: #ffffff; font-family: monospace; } +{% block css %} +{% endblock %} +</style> +<body> +<a href="ledger">ledger</a> +<a href="balance">balance</a> +<a href="edit">add</a> +<hr /> +{% block content %} +{% endblock %} +<script> +{% block script %} +{% endblock %} +</script> diff --git a/ledger_templates/edit.html b/ledger_templates/edit.html new file mode 100644 index 0000000..ecad900 --- /dev/null +++ b/ledger_templates/edit.html @@ -0,0 +1,64 @@ +{% extends 'base.html' %} +{% block css %} +textarea.booking { width: 100%; } +div.savers { float: right; } +input[type=number] { text-align: right; font-family: monospace; } +div.edit_mode_switch { width: 8em; margin-right: 0.5em; border-right: 1px solid #888888; float: left; } +{% endblock %} +{% block content %} +{% if error_msg %}{{error_msg}}{% endif %} +<form method="POST" action="edit?i={{index}}"> +<div class="savers"> +{% if adding %} +<input type="submit" name="add" value="add" /> +{% else %} +<input type="submit" name="update" value="UPDATE (not add!!)" /> +{% endif %} +</div> +<div> +<div class="edit_mode_switch"> +{% if edit_mode == 'textarea' %} +<input type="submit" name="table" value="as table" /> +{% else %} +<input type="submit" name="textarea" value="as textarea" /> +{% endif %} +</div> +<input type="submit" name="check" value="check" /> +<input type="submit" name="mirror" value="mirror" /> +<input type="submit" name="fill_sink" value="fill sink" /> +<input type="submit" name="add_taxes" value="add taxes" /> +<input name="replace_from" /> +<input type="submit" name="replace" value="-> replace ->" /> +<input name="replace_to" /> +</div> +{% if edit_mode == 'textarea' %} +<textarea class="booking" name="booking" rows=100>{% for line in content %}{{ line|e }}{% if not loop.last %} +{% endif %}{% endfor %}</textarea> +{% else %} +<input name="date" value="{{content.date}}" size=9 /> +<input name="description" value="{{content.description|e}}" /> +; <textarea name="top_comment" rows=1 cols={{content.comment_cols}}>{{content.top_comment|e}}</textarea> +<br /> +{% for line in content.transfer_lines %} +<input name="account" value="{{line.account|e}}" size=40 list="accounts" autocomplete="off" /> +<input name="amount" value="{{line.amount}}" type="number" step=0.01 size=10 /> +<input name="currency" value="{{line.currency|e}}" size=3 /> +; <textarea rows=1 cols={{line.comment_cols}} name="comment">{{line.comment|e}}</textarea><br /> +{% endfor %} +{% for i in range(10) %} +<input name="account" value="" size=40 list="accounts" autocomplete="off" /> +<input name="amount" value="" type="number" type="number" step=0.01 size=10 /> +<input name="currency" value="â¬" size=3 /> +; <textarea name="comment" rows=1 ></textarea><br /> +{% endfor %} +<datalist id="accounts"> +{% for acc in accounts %} +<option value="{{acc|e}}">{{acc|e}}</option> +{% endfor %} +</datalist> +{% endif %} +<input type="hidden" name="index" value="{{index}}" /> +<input type="hidden" name="edit_mode" value="{{edit_mode}}" /> +</form> +{% endblock %} + diff --git a/ledger_templates/ledger.html b/ledger_templates/ledger.html new file mode 100644 index 0000000..0696e09 --- /dev/null +++ b/ledger_templates/ledger.html @@ -0,0 +1,34 @@ +{% extends 'base.html' %} +{% block css %} +table { margin: 0; padding: 0; } +table tr { vertical-align: top; } +td.amount { text-align: right; } +td.booking_header { padding-top: 1.5em; } +td.first_booking_header { padding-top: 0; } +button[type=submit] { padding: 0; } +{% endblock %} +{% block content %} +<form method="POST" action="ledger"> +<table> +{% for b in bookings %} +<tr id="{{loop.index0}}"> +<td {% if loop.first %}{% else %}class="booking_header"{% endif %} colspan=3> +<a href="balance?until_after={{loop.index0}}">[B]</a> +<button type="submit" name="move_up" value="{{loop.index0}}"{% if not b.can_up %} disabled {% endif %}>â</button> +<button type="submit" name="move_down" value="{{loop.index0}}"{% if not b.can_down %} disabled {% endif %} />â</button> +<a href="edit?i={{loop.index0}}"><strong>{{b.date}}</strong></a> +<a href="edit?copy=1&i={{loop.index0}}">[C]</a> +{{b.description}}{% if b.top_comment %} <em>; {{b.top_comment}}</em>{% endif %} +</td> +{% for line in b.transfer_lines %} +<tr> +<td class="amount">{{line.amount_fmt}}</td> +<td>{% if line.currency %}{{line.currency|truncate(4,true,'â¦')}}{% endif %}</td> +<td>{{line.account}}{% if line.comment %}<em> ; {{line.comment}}</em>{% endif %}</td> +</tr> +{% endfor %} +</tr> +{% endfor %} +</table> +</form> +{% endblock %} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..8ce973e --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +Jinja2