mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 20:40:17 +02:00
25 lines
687 B
Python
25 lines
687 B
Python
from django.utils.translation import gettext_lazy as _
|
|
from allianceauth import hooks
|
|
|
|
from .hooks import MenuItemHook
|
|
from .hooks import ServicesHook
|
|
|
|
|
|
class Services(MenuItemHook):
|
|
def __init__(self):
|
|
MenuItemHook.__init__(self,
|
|
_('Services'),
|
|
'fa fa-cogs fa-fw',
|
|
'services:services', 100)
|
|
|
|
def render(self, request):
|
|
for svc in ServicesHook.get_services():
|
|
if svc.service_active_for_user(request.user):
|
|
return MenuItemHook.render(self, request)
|
|
return ''
|
|
|
|
|
|
@hooks.register('menu_item_hook')
|
|
def register_menu():
|
|
return Services()
|