Admin Area
+Resolved Tickets
+ {% for staff in data.resolved %} +{% if staff.active %}Active{% else %}Inactive{% endif %} {{ staff.username }}: {{ staff.tickets }}
+ {% endfor %} ++ {% endif %}
diff --git a/overview.py b/overview.py index 609ae1a..3cd626b 100644 --- a/overview.py +++ b/overview.py @@ -3,6 +3,7 @@ import json from datetime import datetime, timedelta from django.conf import settings from minecraft_manager.models import Application, Player, Ticket, Warning, IP +from django.contrib.auth.models import User def overview_data(): @@ -62,4 +63,13 @@ def overview_data(): 'month': Player.objects.filter(last_seen__range=[month, now]).count() } + # Admin + data['resolved'] = [] + for user in User.objects.all().order_by('username'): + data['resolved'].append({ + 'active': user.is_active, + 'username': user.username, + 'tickets': Ticket.objects.filter(staff=user).count() + }) + return data diff --git a/templates/minecraft_manager/overview.html b/templates/minecraft_manager/overview.html index 24ff385..81fb092 100644 --- a/templates/minecraft_manager/overview.html +++ b/templates/minecraft_manager/overview.html @@ -6,6 +6,25 @@ {% endblock %} {% block section %}
{% if staff.active %}Active{% else %}Inactive{% endif %} {{ staff.username }}: {{ staff.tickets }}
+ {% endfor %} +