cmsmanage/membershipworks/dashboard.py

25 lines
606 B
Python

from typing import Any
from django.urls import reverse
import dashboard
@dashboard.register
class MembershipworksDashboardFragment(dashboard.DashboardFragment):
name = "MembershipWorks"
template = "dashboard/links_card.dj.html"
@property
def context(self) -> Any:
links = {}
if self.request.user.has_perm("membershipworks.view_event"):
links["Event Report"] = reverse("membershipworks:event-index-report")
return {"links": links}
@property
def visible(self) -> bool:
return self.request.user.has_perm("doorcontrol.view_hidevent")