You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
961 B
32 lines
961 B
from unfold.components import BaseComponent, register_component
|
|
from django.template.loader import render_to_string
|
|
|
|
from .user import *
|
|
from .location import *
|
|
from .notification import *
|
|
|
|
|
|
@register_component
|
|
class AllUserComponent(BaseComponent):
|
|
def get_context_data(self, **kwargs):
|
|
context = super().get_context_data(**kwargs)
|
|
context["children"] = render_to_string(
|
|
"admin/helpers/kpi_progress.html",
|
|
{
|
|
"total": User.objects.filter(is_active=True).count(),
|
|
},
|
|
)
|
|
return context
|
|
|
|
|
|
@register_component
|
|
class GuestUserComponent(BaseComponent):
|
|
def get_context_data(self, **kwargs):
|
|
context = super().get_context_data(**kwargs)
|
|
context["children"] = render_to_string(
|
|
"admin/helpers/kpi_progress.html",
|
|
{
|
|
"total": User.objects.filter(email__isnull=True).count(),
|
|
},
|
|
)
|
|
return context
|