2024-01-17 21:17:24 -05:00
|
|
|
from typing import Any
|
2024-01-15 21:31:06 -05:00
|
|
|
|
|
|
|
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"):
|
2024-01-19 15:33:54 -05:00
|
|
|
links["Event Report"] = reverse("membershipworks:event-index-report")
|
2024-02-02 19:26:06 -05:00
|
|
|
links["Event Attendees"] = reverse("membershipworks:event-attendees")
|
2024-01-15 21:31:06 -05:00
|
|
|
|
|
|
|
return {"links": links}
|
|
|
|
|
|
|
|
@property
|
|
|
|
def visible(self) -> bool:
|
|
|
|
return self.request.user.has_perm("doorcontrol.view_hidevent")
|