ticket and comment count and badge and new notif

This commit is contained in:
Parsa Nazer
2025-02-05 01:36:21 +03:30
parent d4d06493fb
commit 8700fde8a4
4 changed files with 40 additions and 3 deletions
+5
View File
@@ -8,6 +8,9 @@ from django.utils.translation import gettext_lazy as _
from django.views.generic import RedirectView, TemplateView
from unfold.views import UnfoldModelAdminViewMixin
from order.models import OrderModel
from ticket.models import Ticket
class HomeView(RedirectView):
pattern_name = "admin:index"
@@ -16,8 +19,10 @@ class HomeView(RedirectView):
def dashboard_callback(request, context):
pending_count = OrderModel.objects.filter(status='ADMIN_PENDING').count()
open_tickets_count = Ticket.objects.filter(status__in=['open', 'in_progress']).count()
context.update(random_data())
context.update({'pending_count': pending_count})
context.update({'open_tickets_count': open_tickets_count})
return context