aboutsummaryrefslogtreecommitdiff
path: root/budget/templates
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-07-31 15:39:32 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2011-07-31 16:33:29 +0200
commit37be0f4fa196de8c160f1ec59978fd3c15a8bf8d (patch)
tree39f0568a851e69dd98de20b467259c63fe2410c1 /budget/templates
parent3417a5a7d48ade7744586a711127d2302f58109a (diff)
downloadihatemoney-mirror-37be0f4fa196de8c160f1ec59978fd3c15a8bf8d.zip
ihatemoney-mirror-37be0f4fa196de8c160f1ec59978fd3c15a8bf8d.tar.gz
ihatemoney-mirror-37be0f4fa196de8c160f1ec59978fd3c15a8bf8d.tar.bz2
Theming.
Uses uni-form to style forms and add a macro to ease this. Of course, the overall thing has to be reworked, but having this in place will help us to have something easier to change when we will really care about design. All the form templates can now be defined in templates/forms.html and be called thansk to {{ forms.name_of_the_form(form) }}. I've done some styling, but that's really not my thing, feel free to modify it.
Diffstat (limited to 'budget/templates')
-rw-r--r--budget/templates/bill_form.html11
-rw-r--r--budget/templates/forms.html13
-rw-r--r--budget/templates/recent_projects.html8
3 files changed, 32 insertions, 0 deletions
diff --git a/budget/templates/bill_form.html b/budget/templates/bill_form.html
new file mode 100644
index 0000000..61b4004
--- /dev/null
+++ b/budget/templates/bill_form.html
@@ -0,0 +1,11 @@
+{% import "forms.html" as forms %}
+<div class="uniForm">
+<form action="{{ url_for('add_bill', project_id=project.id) }}" method="post" class=uniForm">
+ {{ form.hidden_tag() }}
+ {{ forms.input(form.what) }}
+ {{ forms.input(form.payer) }}
+ {{ forms.input(form.amount) }}
+ {{ forms.input(form.payed_for, multiple=True) }}
+ <p>{{ form.submit }}</p>
+</form>
+</div>
diff --git a/budget/templates/forms.html b/budget/templates/forms.html
new file mode 100644
index 0000000..234143b
--- /dev/null
+++ b/budget/templates/forms.html
@@ -0,0 +1,13 @@
+{% macro input(field, multiple=False) -%}
+ <div class="ctrlHolder">
+ {{ field.label }}
+ {% if multiple == True %}
+ {{ field(multiple=True) }}
+ {% else %}
+ {{ field }}
+ {% endif %}
+ {% if field.description %}
+ <p class="formHint">{{ field.description }}</p>
+ {% endif %}
+ </div>
+{% endmacro %}
diff --git a/budget/templates/recent_projects.html b/budget/templates/recent_projects.html
new file mode 100644
index 0000000..423db7e
--- /dev/null
+++ b/budget/templates/recent_projects.html
@@ -0,0 +1,8 @@
+{% if 'projects' in session %}
+ <h3>Recently visisted projects</h3>
+ <ul>
+ {% for id, name in session['projects'] %}
+ <li><a href="{{ url_for("list_bills", project_id=id) }}">{{ name }}</a></li>
+ {% endfor %}
+ </ul>
+{% endif %}