cmsmanage/dashboard/dashboard.py
Adam Goldsmith 10cfc151e1
All checks were successful
Ruff / ruff (push) Successful in 1m46s
Test / test (push) Successful in 7m5s
dashboard: Add fragment with links to some misc external apps
2024-03-15 23:38:22 -04:00

43 lines
1.2 KiB
Python

import dashboard
from dashboard import Link
from membershipworks.models import Member
from paperwork.models import Department
@dashboard.register
class ExternalAppsDashboardFragment(dashboard.LinksCardDashboardFragment):
name = "External Applications"
@property
def links(self):
links = [
Link(
"Wiki",
"https://wiki.claremontmakerspace.org",
tooltip="Uses CMS Network Computing account",
permission=None,
),
Link(
"Mailman",
"http://mailman.claremontmakerspace.org",
tooltip="Mailing list management. Uses its own authentication, for now",
permission=None,
),
]
member = Member.from_user(self.request.user)
if (
member is not None
and Department.objects.filter(shop_lead_flag__members=member).exists()
):
links.append(
Link(
"Ticketing System",
"https://tickets.claremontmakerspace.org/scp/",
tooltip="Uses CMS Network Computing account",
permission=None,
)
)
return links