From: Tollef Fog Heen Date: Sun, 3 Jun 2012 13:24:07 +0000 (+0200) Subject: Show invoices needing work on front page X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f30f66f848c98f4300343e396728f85b4d2bb98b;p=peojumk Show invoices needing work on front page --- 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 %}