Add form css for category

This commit is contained in:
Edgar P. Burkhart 2022-05-20 21:59:10 +02:00
parent 30db14669f
commit 038261e97c
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -1,18 +1,37 @@
{% extends "main/base.html" %} {% extends "main/base.html" %}
{% load static %}
{% block link %}
{{ block.super }}
<link rel="stylesheet" href="{% static 'css/form.css' %}" type="text/css" />
{% endblock %}
{% block body %} {% block body %}
<h1>{{ category.tree|join:" → " }}</h1> <h1>{{ category }}</h1>
<form action="{% url 'update_category' category.id %}" method="post"> <form action="{% url 'update_category' category.id %}" method="post">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {% for field in form %}
<input type="submit" /> {{ field.errors }}
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
{% endfor %}
<div class="buttons">
<input type="reset" />
<input type="submit" value="Save Category" />
</div>
</form> </form>
{% if transactions %} {% if transactions %}
<h2>Transactions ({{ transactions|length }})</h2> <h2>Transactions ({{ transactions|length }})</h2>
<ul> <ul>
{{ transactions|unordered_list }} {% for transaction in transactions %}
<li>
<a href="{% url 'transaction' transaction.id %}">
{{ transaction }}
</a>
</li>
{% endfor %}
</ul> </ul>
{% endif %} {% endif %}
{% endblock %} {% endblock %}