diff options
Diffstat (limited to 'budget/templates')
| -rw-r--r-- | budget/templates/bill_form.html | 11 | ||||
| -rw-r--r-- | budget/templates/forms.html | 13 | ||||
| -rw-r--r-- | budget/templates/recent_projects.html | 8 |
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 %} |
