diff options
Diffstat (limited to 'budget/templates')
| -rw-r--r-- | budget/templates/add_bill.html | 20 | ||||
| -rw-r--r-- | budget/templates/compute_bills.html | 26 | ||||
| -rw-r--r-- | budget/templates/layout. | 0 | ||||
| -rw-r--r-- | budget/templates/layout.html | 34 | ||||
| -rw-r--r-- | budget/templates/layout.txt | 2 | ||||
| -rw-r--r-- | budget/templates/list_bills.html | 25 |
6 files changed, 107 insertions, 0 deletions
diff --git a/budget/templates/add_bill.html b/budget/templates/add_bill.html new file mode 100644 index 0000000..37ecfa3 --- /dev/null +++ b/budget/templates/add_bill.html @@ -0,0 +1,20 @@ +{% extends "layout.html" %} + +{% block content %} +<h2>Let's add a bill</h2> + +{% if form.errors %} + <p class=error><strong>Your form contains errors.</strong></p> + <ul>{% for error in form.errors %}<li>{{ error }}</li>{% endfor %}</ul> +{% endif %} + + <form action="{{ url_for('add_bill') }}" method=post class="container span-24 add-bill"> + {{ form.hidden_tag() }} + + <p>{{ form.payer.label }}<br /> {{ form.payer }}</p> + <p>{{ form.what.label }}<br /> {{ form.what }}</p> + <p>{{ form.amount.label }}<br />{{ form.amount }}</p> + <p>{{ form.payed_for.label }}<br /> {{ form.payed_for(multiple=True) }}</p> + <p>{{ form.submit }}</p> + </form> +{% endblock %} diff --git a/budget/templates/compute_bills.html b/budget/templates/compute_bills.html new file mode 100644 index 0000000..d1cad15 --- /dev/null +++ b/budget/templates/compute_bills.html @@ -0,0 +1,26 @@ +{% extends "layout.html" %} +{% block content %} +<h2>Computations</h2> + +<div class="container span-16"> + <ol> + <li>For each person, get the list of bills he have to pay</li> + <li>Increase the amount this person have to pay</li> + <li>At the same time, increase what the payer of the bill have to receive</li> + <li>At the end, for each person, substract what he have to pay to what he have to receive</li> + </ol> +</div> + +<div class="container span-6 last"> + <a class="awesome large green button" href="{{ url_for("reset_bills") }}">Mark this as payed / processed</a> +</div> + +<table> + <thead><tr><th>Name</th><th>Balance</th></tr></thead> + <tbody> +{% for name, balance in balances.items() %} + <tr><td>{{ name }}</td><td>{{ balance }}</td></tr> +{% endfor %} + </tbody> +</table> +{% endblock %} diff --git a/budget/templates/layout. b/budget/templates/layout. new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/budget/templates/layout. diff --git a/budget/templates/layout.html b/budget/templates/layout.html new file mode 100644 index 0000000..50f1884 --- /dev/null +++ b/budget/templates/layout.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html> +<head> +<title>Account manager</title> +<link rel=stylesheet type=text/css href="{{ url_for('static', filename='main.css') }}"> +</head> +<body> + +<div class="container" class="span-24"> + <div id="title"> + <div class="span-18"> + <a href="/"><h1>Account manager ! <span class="small">Manage your shared expenses.</span></h1></a> + </div> + <div class="span-6 last" id="topmenu"> + <ul> + <li><a class="awesome large orange button" href="{{ url_for("add_bill") }}">Add a bill !</a></li> + </ul> + </div> + </div> + <hr> + <div id="content" class="span-24"> + + {% for message in get_flashed_messages() %} + <div class=info>{{ message }}</div> + {% endfor %} + + {% block content %} + {% endblock %} + + </div> + <div id="footer"></div> +</div> +</body> +</html> diff --git a/budget/templates/layout.txt b/budget/templates/layout.txt new file mode 100644 index 0000000..c6afe66 --- /dev/null +++ b/budget/templates/layout.txt @@ -0,0 +1,2 @@ +{% block content %} +{% endblock %}
\ No newline at end of file diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html new file mode 100644 index 0000000..fba328e --- /dev/null +++ b/budget/templates/list_bills.html @@ -0,0 +1,25 @@ +{% extends "layout.html" %} +{% block content %} +{% if bills.count() > 0 %} +<table> +<thead><tr><th>When ?</th><th>Who paid?</th><th>for what ?</th><th>Owers</th><th>How much ?</th></tr></thead> +<tbody> +{% for bill in bills %} +<tr class="{{ loop.cycle("odd", "even") }}"> + <td>{{ bill.date }}</td> + <td>{{ bill.payer }}</td> + <td>{{ bill.what }}</td> + <td>{% for ower in bill.owers %}{{ ower.name }} {% endfor %}</td> + <td>{{ bill.amount }} ({{ bill.pay_each() }} each)</td> +</tr> +{% endfor %} +</tbody> +</table> + +<a class="awesome large green button fleft" href="{{ url_for("compute_bills") }}">Compute bills</a> +<p> Periodically (probably at the end of each month, you can compute the balance of each people, in order to reset all the debts. You can also let this "as-is" and try to find a good balance, that's up to you</p> + +{% else %} +<p>Nothing to list yet. You probably want to <a href="{{ url_for("add_bill") }}">add a bill</a> ?</p> +{% endif %} +{% endblock %} |
