mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-12 14:00:17 +02:00
30 lines
701 B
Python
30 lines
701 B
Python
from allianceauth.services.hooks import MenuItemHook, UrlHook
|
|
|
|
from allianceauth import hooks
|
|
from . import urls
|
|
|
|
|
|
class TimerboardMenu(MenuItemHook):
|
|
def __init__(self):
|
|
MenuItemHook.__init__(
|
|
self, 'Structure Timers',
|
|
'far fa-clock fa-fw',
|
|
'timerboard:view',
|
|
navactive=['timerboard:']
|
|
)
|
|
|
|
def render(self, request):
|
|
if request.user.has_perm('auth.timer_view'):
|
|
return MenuItemHook.render(self, request)
|
|
return ''
|
|
|
|
|
|
@hooks.register('menu_item_hook')
|
|
def register_menu():
|
|
return TimerboardMenu()
|
|
|
|
|
|
@hooks.register('url_hook')
|
|
def register_url():
|
|
return UrlHook(urls, 'timerboard', r'^timers/')
|