2023-04-14 01:24:36 -04:00
|
|
|
from typing import Any
|
|
|
|
|
|
|
|
import dashboard
|
2023-12-01 11:55:28 -05:00
|
|
|
from .views import REPORTS
|
2023-04-14 01:24:36 -04:00
|
|
|
|
|
|
|
|
|
|
|
@dashboard.register
|
|
|
|
class DoorControlDashboardFragment(dashboard.DashboardFragment):
|
|
|
|
name = "Door Controls"
|
|
|
|
template = "dashboard/links_card.dj.html"
|
|
|
|
|
|
|
|
@property
|
|
|
|
def context(self) -> Any:
|
|
|
|
return {
|
2023-12-01 11:55:28 -05:00
|
|
|
"links": dict(rt for report in REPORTS for rt in report._report_types())
|
2023-04-14 01:24:36 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
@property
|
|
|
|
def visible(self) -> bool:
|
|
|
|
return self.request.user.has_perm("doorcontrol.view_hidevent")
|