diff --git a/doorcontrol/dashboard.py b/doorcontrol/dashboard.py index 6050753..7db8e52 100644 --- a/doorcontrol/dashboard.py +++ b/doorcontrol/dashboard.py @@ -1,8 +1,7 @@ from typing import Any -from django.urls import reverse - import dashboard +from .views import REPORTS @dashboard.register @@ -13,16 +12,7 @@ class DoorControlDashboardFragment(dashboard.DashboardFragment): @property def context(self) -> Any: return { - "links": { - "Access Per Day": reverse( - "doorcontrol:access-per-unit-time", kwargs={"unit_time": "day"} - ), - "Access Per Month": reverse( - "doorcontrol:access-per-unit-time", kwargs={"unit_time": "month"} - ), - "Access Failures": reverse("doorcontrol:denied-access"), - "Most Active Members": reverse("doorcontrol:most-active-members"), - } + "links": dict(rt for report in REPORTS for rt in report._report_types()) } @property