mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-06 15:16:20 +01:00
Move templates and urls to apps.
Implement url hooks. Many apps are now removable. Default to assuming services have been migrated.
This commit is contained in:
32
corputils/auth_hooks.py
Normal file
32
corputils/auth_hooks.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from services.hooks import MenuItemHook, UrlHook
|
||||
from alliance_auth import hooks
|
||||
from corputils import urls
|
||||
|
||||
|
||||
class CorpStats(MenuItemHook):
|
||||
def __init__(self):
|
||||
MenuItemHook.__init__(self,
|
||||
'Corporation Stats',
|
||||
'fa fa-share-alt fa-fw grayiconecolor',
|
||||
'corputils:view',
|
||||
navactive=['corputils:'])
|
||||
|
||||
def render(self, request):
|
||||
if request.user.has_perm('corputils.view_corp_corpstats') or request.user.has_perm('corputils.view_alliance_corpstats') or request.user.has_perm('corputils.add_corpstats'):
|
||||
return MenuItemHook.render(self, request)
|
||||
return ''
|
||||
|
||||
|
||||
@hooks.register('menu_item_hook')
|
||||
def register_menu():
|
||||
return CorpStats()
|
||||
|
||||
|
||||
class CorpStatsUrl(UrlHook):
|
||||
def __init__(self):
|
||||
UrlHook.__init__(self, urls, 'corputils', r'^corpstats/')
|
||||
|
||||
|
||||
@hooks.register('url_hook')
|
||||
def register_url():
|
||||
return CorpStatsUrl()
|
||||
@@ -2,7 +2,6 @@
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
{% load bootstrap_pagination %}
|
||||
{% load eveonline_extras %}
|
||||
{% block member_data %}
|
||||
{% if corpstats %}
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user