8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 09:26:27 +00:00

regle l'affichage sur le profil

This commit is contained in:
Grizzly 2019-08-10 08:12:49 +00:00 committed by Gabriel Detraz
parent 49184d32d6
commit 02a4305cbd

View file

@ -103,8 +103,24 @@ def edit_preferences(request):
# views cannoniques des apps optionnels
def profil(request,user):
""" Vue cannonique d'affichage des tickets dans l'accordeon du profil"""
tickets = Ticket.objects.filter(user=user).all().order_by('-date')
context = {'tickets_list':tickets}
tickets_list = Ticket.objects.filter(user=user).all().order_by('-date')
last_ticket_date = tickets_list.first().date
nbr_tickets = tickets_list.count()
nbr_tickets_unsolved = tickets_list.filter(solved=False).count()
pagination_number = (GeneralOption
.get_cached_value('pagination_large_number'))
tickets = re2o_paginator(
request,
tickets_list,
pagination_number,
)
context = {'tickets_list':tickets,
'last_ticket_date':last_ticket_date,
'nbr_tickets':nbr_tickets,
'nbr_tickets_unsolved':nbr_tickets_unsolved}
return render_to_string('tickets/profil.html', context=context, request=request, using=None)
def preferences(request):