cmsmanage/membershipworks/dashboard.py

38 lines
1.0 KiB
Python

from django.urls import reverse
import dashboard
from dashboard import Link
@dashboard.register
class MembershipworksDashboardFragment(dashboard.LinksCardDashboardFragment):
name = "MembershipWorks"
links = [
Link(
"Upcoming Events",
reverse("membershipworks:upcoming-events"),
permission="membershipworks.view_event",
tooltip="Generator for Wordpress posts",
),
Link(
"Event Report",
reverse("membershipworks:event-index-report"),
permission="membershipworks.view_event",
),
Link(
"Event Attendees",
reverse("membershipworks:event-attendees"),
permission="membershipworks.view_event",
),
Link(
"Missing Paperwork",
reverse("membershipworks:missing-paperwork-report"),
permission="membershipworks.view_member",
),
]
@property
def visible(self) -> bool:
return self.request.user.has_perm("doorcontrol.view_hidevent")