from typing import Any import dashboard from .views import REPORTS @dashboard.register class DoorControlDashboardFragment(dashboard.DashboardFragment): name = "Door Controls" template = "dashboard/links_card.dj.html" @property def context(self) -> Any: return { "links": dict(rt for report in REPORTS for rt in report._report_types()) } @property def visible(self) -> bool: return self.request.user.has_perm("doorcontrol.view_hidevent")