From 10cfc151e1aeff0e49faca9606dee50708329378 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 15 Mar 2024 23:37:54 -0400 Subject: [PATCH] dashboard: Add fragment with links to some misc external apps --- dashboard/dashboard.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/dashboard/dashboard.py b/dashboard/dashboard.py index e69de29..0f7a3bc 100644 --- a/dashboard/dashboard.py +++ b/dashboard/dashboard.py @@ -0,0 +1,42 @@ +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