doorcontrol: Generate dashboard links for all reports
This commit is contained in:
parent
654d5e34bd
commit
caf8c2cf45
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user