diff --git a/tickets/templates/tickets/aff_ticket.html b/tickets/templates/tickets/aff_ticket.html index f56a6b6c..7bf5b04d 100644 --- a/tickets/templates/tickets/aff_ticket.html +++ b/tickets/templates/tickets/aff_ticket.html @@ -31,7 +31,13 @@ with this program; if not, write to the Free Software Foundation, Inc., {% block content %} -
diff --git a/tickets/views.py b/tickets/views.py index 0e89218d..7a86ecf4 100644 --- a/tickets/views.py +++ b/tickets/views.py @@ -57,8 +57,15 @@ def aff_ticket(request,ticketid): def aff_tickets(request): """ Vue d'affichage de tout les tickets """ tickets = Ticket.objects.all().order_by('-date') - return render(request,'tickets/index.html', - {'tickets_list':tickets}) + last_ticket_date = tickets.first().date + nbr_tickets = tickets.count() + nbr_tickets_unsolved = Ticket.objects.filter(solved=False).count() + context = {'tickets_list':tickets, + 'last_ticket_date':last_ticket_date, + 'nbr_tickets':nbr_tickets, + 'nbr_tickets_unsolved':nbr_tickets_unsolved} + + return render(request,'tickets/index.html',context=context) def edit_preferences(request): """ Vue d'édition des préférences des tickets """ |
---|