diff options
Diffstat (limited to 'budget/templates')
| -rw-r--r-- | budget/templates/add_bill.html | 3 | ||||
| -rw-r--r-- | budget/templates/create_archive.html | 7 | ||||
| -rw-r--r-- | budget/templates/forms.html | 16 | ||||
| -rw-r--r-- | budget/templates/list_bills.html | 2 |
4 files changed, 23 insertions, 5 deletions
diff --git a/budget/templates/add_bill.html b/budget/templates/add_bill.html index ec60f43..0b575d7 100644 --- a/budget/templates/add_bill.html +++ b/budget/templates/add_bill.html @@ -5,9 +5,8 @@ {% endblock %} {% block content %} -<h2>{% if edit %}Edit a{% else %}Add a new{% endif %} bill</h2> <form method="post"> - {{ forms.add_bill(form) }} + {{ forms.add_bill(form, edit) }} </form> {% endblock %} diff --git a/budget/templates/create_archive.html b/budget/templates/create_archive.html new file mode 100644 index 0000000..ae96a30 --- /dev/null +++ b/budget/templates/create_archive.html @@ -0,0 +1,7 @@ +{% extends "layout.html" %} + +{% block content %} +<form method="post" accept-charset="utf-8"> +{{ forms.create_archive(form) }} +</form> +{% endblock %} diff --git a/budget/templates/forms.html b/budget/templates/forms.html index 8ac458f..7b512ff 100644 --- a/budget/templates/forms.html +++ b/budget/templates/forms.html @@ -52,10 +52,10 @@ {% endmacro %} -{% macro add_bill(form) %} +{% macro add_bill(form, edit=False) %} <fieldset> - <legend>Add a bill</legend> + <legend>{% if edit %}Edit this {% else %}Add a {% endif %}bill</legend> {% include "display_errors.html" %} {{ form.hidden_tag() }} {{ input(form.date) }} @@ -83,3 +83,15 @@ <a href="{{ url_for("list_bills") }}">No, thanks</a> </div> {% endmacro %} + +{% macro create_archive(form) %} + <fieldset> + <legend>Create an archive</legend> + {{ form.hidden_tag() }} + {{ input(form.start_date) }} + {{ input(form.end_date) }} + </fieldset> + <div class="actions"> + <button class="btn">Create the archive</button> + </div> +{% endmacro %} diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html index e9699dd..b485f81 100644 --- a/budget/templates/list_bills.html +++ b/budget/templates/list_bills.html @@ -78,7 +78,7 @@ <td>{% for ower in bill.owers %}{{ ower.name }} {% endfor %}</td> <td>{{ bill.amount }} ({{ bill.pay_each() }} each)</td> <td><a href="{{ url_for("edit_bill", bill_id=bill.id) }}">edit</a> - <a href="{{ url_for("delete_bill", bill_id=bill.id) }}">delete</a></td> + <a class="delete" href="{{ url_for("delete_bill", bill_id=bill.id) }}">delete</a></td> </tr> {% endfor %} </tbody> |
