aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-03-10 02:37:21 +0000
committerAlexis Metaireau <alexis@notmyidea.org>2011-03-10 02:37:21 +0000
commitb3db90545c5bd76d4acb6abfe5356e87b0f0cdcf (patch)
treed3ddbd294fc79428948e9dfcb9a4be89702e60e7 /templates
downloadihatemoney-mirror-b3db90545c5bd76d4acb6abfe5356e87b0f0cdcf.zip
ihatemoney-mirror-b3db90545c5bd76d4acb6abfe5356e87b0f0cdcf.tar.gz
ihatemoney-mirror-b3db90545c5bd76d4acb6abfe5356e87b0f0cdcf.tar.bz2
initial import
Diffstat (limited to 'templates')
-rw-r--r--templates/add_bill.html20
-rw-r--r--templates/compute_bills.html26
-rw-r--r--templates/layout.0
-rw-r--r--templates/layout.html34
-rw-r--r--templates/layout.txt2
-rw-r--r--templates/list_bills.html25
6 files changed, 107 insertions, 0 deletions
diff --git a/templates/add_bill.html b/templates/add_bill.html
new file mode 100644
index 0000000..37ecfa3
--- /dev/null
+++ b/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/templates/compute_bills.html b/templates/compute_bills.html
new file mode 100644
index 0000000..d1cad15
--- /dev/null
+++ b/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/templates/layout. b/templates/layout.
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/templates/layout.
diff --git a/templates/layout.html b/templates/layout.html
new file mode 100644
index 0000000..50f1884
--- /dev/null
+++ b/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/templates/layout.txt b/templates/layout.txt
new file mode 100644
index 0000000..c6afe66
--- /dev/null
+++ b/templates/layout.txt
@@ -0,0 +1,2 @@
+{% block content %}
+{% endblock %} \ No newline at end of file
diff --git a/templates/list_bills.html b/templates/list_bills.html
new file mode 100644
index 0000000..fba328e
--- /dev/null
+++ b/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 %}