Use form template

This commit is contained in:
Edgar P. Burkhart 2022-05-22 18:14:11 +02:00
parent c5ac2d83c7
commit 11c215e4d8
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
6 changed files with 20 additions and 22 deletions

View file

@ -13,11 +13,7 @@
<form action="{% url 'update_category' category.id %}" method="post">
{% csrf_token %}
{% for field in form %}
{{ field.errors }}
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
{% endfor %}
{{ form }}
<div class="buttons">
<a href="{% url 'del_category' category.id %}"><input type="button" value="Delete" class="btn del" /></a>
<input type="reset" />

View file

@ -0,0 +1,5 @@
{% for field in form %}
{{ field.errors }}
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
{% endfor %}

View file

@ -23,11 +23,7 @@
<form action="{% url 'update_snapshot' snapshot.id %}" method="post">
{% csrf_token %}
{% for field in form %}
{{ field.errors }}
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
{% endfor %}
{{ form }}
<div class="buttons">
<a href="{% url 'del_snapshot' snapshot.date %}"><input type="button" value="Delete" class="del" /></a>
<input type="reset" />

View file

@ -12,11 +12,7 @@
{% spaceless %}
<form id="transaction" action="{% url 'update_transaction' transaction.id %}" method="post">
{% csrf_token %}
{% for field in form %}
{{ field.errors }}
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
{% endfor %}
{{ form }}
<div class="buttons">
<a href="{% url 'del_transaction' transaction.id %}"><input type="button" value="Delete" class="btn del" /></a>
<input class="btn" type="reset" />
@ -41,11 +37,7 @@
<h3>Add Invoice</h3>
<form action="{% url 'add_invoice' transaction.id %}" method="post" enctype="multipart/form-data">
{% csrf_token %}
{% for field in invoice_form %}
{{ field.errors }}
<label for="{{ field.id_for_label }}">{{field.label }}</label>
{{ field }}
{% endfor %}
{{ invoice_form }}
<div class="buttons"><input class="btn" type="submit" value="Add Invoice" /></div>
</form>
{% endblock %}