Add base template

This commit is contained in:
Edgar P. Burkhart 2022-05-19 21:57:27 +02:00
parent fbff835598
commit 60b73d8546
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
3 changed files with 28 additions and 2 deletions

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>{% block title %}Nummi{% endblock %}</title>
{% block link %}
{% endblock %}
</head>
<body>
{% block body %}
{% endblock %}
</body>
</html>

View File

@ -1,3 +1,8 @@
{% extends "main/base.html" %}
{% block body %}
<h1>Nummi</h1>
<a href="{% url 'transaction' %}">Add transaction</a> <a href="{% url 'transaction' %}">Add transaction</a>
{% if transactions %} {% if transactions %}
@ -7,3 +12,4 @@
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
{% endblock %}

View File

@ -1,9 +1,12 @@
{% extends "main/base.html" %}
{% block body %}
<a href="{% url 'index' %}">Home</a> <a href="{% url 'index' %}">Home</a>
<h1>{{ transaction }}</h1> <h1>{{ transaction }}</h1>
<form action="{% url 'update_transaction' transaction.id %}" method="post"> <form action="{% url 'update_transaction' transaction.id %}" method="post">
{% csrf_token %} {% csrf_token %}
{{ form }} {{ form.as_p }}
<input type="submit" /> <input type="submit" />
</form> </form>
@ -16,6 +19,7 @@
<a href="{% url 'del_invoice' transaction.id inv.id %}">x</a> <a href="{% url 'del_invoice' transaction.id inv.id %}">x</a>
</li> </li>
{% endfor %} {% endfor %}
<li>{{ invoice_form }}<input type="submit" /></li> <li>{{ invoice_form.as_p }}<input type="submit" /></li>
</ul> </ul>
</form> </form>
{% endblock %}