aboutsummaryrefslogtreecommitdiff
path: root/budget/templates
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-07-23 15:54:23 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2011-07-23 15:54:23 +0200
commit4fcaf7d7ec583b794c14597d50abc89ef96450c9 (patch)
tree16fcff5d5f304a92ff80c92bbbfac5ca9c61b66c /budget/templates
parent54de7abf23f61df916fe65f590d0d45ec8e2d174 (diff)
downloadihatemoney-mirror-4fcaf7d7ec583b794c14597d50abc89ef96450c9.zip
ihatemoney-mirror-4fcaf7d7ec583b794c14597d50abc89ef96450c9.tar.gz
ihatemoney-mirror-4fcaf7d7ec583b794c14597d50abc89ef96450c9.tar.bz2
Kick-start multiple projects support.
This commit adds: * support for projects (creation not yet finished) * an authentication mechanism * bugs (basically all the features are not working anymore)
Diffstat (limited to 'budget/templates')
-rw-r--r--budget/templates/add_bill.html2
-rw-r--r--budget/templates/authenticate.html14
-rw-r--r--budget/templates/create_project.html21
-rw-r--r--budget/templates/debug.html1
-rw-r--r--budget/templates/layout.html4
-rw-r--r--budget/templates/list_bills.html6
6 files changed, 41 insertions, 7 deletions
diff --git a/budget/templates/add_bill.html b/budget/templates/add_bill.html
index 37ecfa3..9b13b2e 100644
--- a/budget/templates/add_bill.html
+++ b/budget/templates/add_bill.html
@@ -8,7 +8,7 @@
<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 action="{{ url_for('add_bill', project_id=project.id) }}" method=post class="container span-24 add-bill">
{{ form.hidden_tag() }}
<p>{{ form.payer.label }}<br /> {{ form.payer }}</p>
diff --git a/budget/templates/authenticate.html b/budget/templates/authenticate.html
new file mode 100644
index 0000000..c745e9f
--- /dev/null
+++ b/budget/templates/authenticate.html
@@ -0,0 +1,14 @@
+{% extends "layout.html" %}
+{% block content %}
+<h2>Login to "{{ project.name }}"</h2>
+
+{% for errors in form.errors.values() %}
+<p class=error>{{ ", ".join(errors) }}</p>
+{% endfor %}
+
+<form action="" method="POST" accept-charset="utf-8">
+ {{ form.hidden_tag() }}
+ Password: <input type="password" name="password" value="">
+ <p>{{ form.submit }}</p>
+</form>
+{% endblock %}
diff --git a/budget/templates/create_project.html b/budget/templates/create_project.html
new file mode 100644
index 0000000..524a592
--- /dev/null
+++ b/budget/templates/create_project.html
@@ -0,0 +1,21 @@
+{% extends "layout.html" %}
+
+{% block content %}
+<h2>Create a new project</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 method="POST" class="container span-24 add-bill">
+ {{ form.hidden_tag() }}
+
+ <p>{{ form.name.label }}<br /> {{ form.name }}</p>
+ <p>{{ form.id.label }}<br /> {{ form.id }}</p>
+ <p>{{ form.password.label }}<br /> {{ form.password }}</p>
+ <p>{{ form.contact_email.label }}<br /> {{ form.contact_email }}</p>
+ <p>{{ form.submit }}</p>
+ </form>
+{% endblock %}
+
diff --git a/budget/templates/debug.html b/budget/templates/debug.html
new file mode 100644
index 0000000..6f97667
--- /dev/null
+++ b/budget/templates/debug.html
@@ -0,0 +1 @@
+Yeah
diff --git a/budget/templates/layout.html b/budget/templates/layout.html
index 50f1884..19c0e59 100644
--- a/budget/templates/layout.html
+++ b/budget/templates/layout.html
@@ -12,9 +12,7 @@
<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>
+ {% block top_menu %}{% endblock %}
</div>
</div>
<hr>
diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html
index 09caa48..d0f0c41 100644
--- a/budget/templates/list_bills.html
+++ b/budget/templates/list_bills.html
@@ -11,16 +11,16 @@
<td>{{ bill.what }}</td>
<td>{% for ower in bill.owers %}{{ ower.name }} {% endfor %}</td>
<td>{{ bill.amount }} ({{ bill.pay_each() }} each)</td>
- <td><a href="{{ url_for("delete_bill", bill_id=bill.id) }}">delete</a></td>
+ <td><a href="{{ url_for("delete_bill", bill_id=bill.id, project_id=project.id) }}">delete</a></td>
</tr>
{% endfor %}
</tbody>
</table>
-<a class="awesome large green button fleft" href="{{ url_for("compute_bills") }}">Compute bills</a>
+<a class="awesome large green button fleft" href="{{ url_for("compute_bills", project_id=project.id) }}">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>
+<p>Nothing to list yet. You probably want to <a href="{{ url_for("add_bill", project_id=project.id) }}">add a bill</a> ?</p>
{% endif %}
{% endblock %}