From f30f66f848c98f4300343e396728f85b4d2bb98b Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Sun, 3 Jun 2012 15:24:07 +0200 Subject: [PATCH] Show invoices needing work on front page --- invoice/views.py | 4 +++- templates/invoice/index.html | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/invoice/views.py b/invoice/views.py index 28f5b44..1fdee68 100644 --- a/invoice/views.py +++ b/invoice/views.py @@ -16,7 +16,9 @@ from invoice.forms import ClientForm, InvoiceForm @login_required def index(request): clients = Client.objects.all() - return render_to_response('invoice/index.html', {'clients': clients}) + new_invoices = Invoice.objects.filter(status = 'N') + sent_invoices = Invoice.objects.filter(status = 'S') + return render_to_response('invoice/index.html', locals()) # ------------------- CLIENT --------------- diff --git a/templates/invoice/index.html b/templates/invoice/index.html index 57a2061..4b268b8 100644 --- a/templates/invoice/index.html +++ b/templates/invoice/index.html @@ -1 +1,23 @@ {% extends "base_site.html" %} +{% block content %} + + + + + + +{% for i in new_invoices %} + + + + + +{% endfor %} +
Date + Customer + Total sum +
{{ i.date }}{{ i.customer }}{{ i.currency }} {{ i.total_sum }}
+ +{% endblock %} -- 2.39.5