mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-09 03:16:25 +00:00
regle l'affichage sur le profil
This commit is contained in:
parent
49184d32d6
commit
02a4305cbd
1 changed files with 18 additions and 2 deletions
|
@ -103,8 +103,24 @@ def edit_preferences(request):
|
||||||
# views cannoniques des apps optionnels
|
# views cannoniques des apps optionnels
|
||||||
def profil(request,user):
|
def profil(request,user):
|
||||||
""" Vue cannonique d'affichage des tickets dans l'accordeon du profil"""
|
""" Vue cannonique d'affichage des tickets dans l'accordeon du profil"""
|
||||||
tickets = Ticket.objects.filter(user=user).all().order_by('-date')
|
tickets_list = Ticket.objects.filter(user=user).all().order_by('-date')
|
||||||
context = {'tickets_list':tickets}
|
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)
|
return render_to_string('tickets/profil.html', context=context, request=request, using=None)
|
||||||
|
|
||||||
def preferences(request):
|
def preferences(request):
|
||||||
|
|
Loading…
Reference in a new issue