diff --git a/dashboard/views.py b/dashboard/views.py index 8a34f1d..2fa7cdd 100644 --- a/dashboard/views.py +++ b/dashboard/views.py @@ -3,6 +3,8 @@ from django.contrib.auth.mixins import LoginRequiredMixin from accounts import resource_action from django.views import generic +from accounts.models import IAmPrincipal + # Create your views here. @@ -13,4 +15,8 @@ class DashboardView(LoginRequiredMixin, generic.TemplateView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["page_name"] = self.page_name + context["active_users"] = IAmPrincipal.objects.filter( + deleted=False, is_active=True + ).count() + context["total_users"] = IAmPrincipal.objects.all().count() return context diff --git a/templates/dashboard/main-dashboard.html b/templates/dashboard/main-dashboard.html index 68062a2..b12d587 100644 --- a/templates/dashboard/main-dashboard.html +++ b/templates/dashboard/main-dashboard.html @@ -17,7 +17,7 @@
-

4578

+

{{ active_users }}

@@ -37,7 +37,7 @@
-

545454

+

{{ total_users }}

@@ -47,11 +47,11 @@
-
+
diff --git a/templates/elements/header.html b/templates/elements/header.html index 03d6514..69db22d 100644 --- a/templates/elements/header.html +++ b/templates/elements/header.html @@ -78,7 +78,7 @@ -