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:
Adarnof
2017-06-07 22:49:46 -04:00
parent 9cc9a36766
commit 97fe2ddfd0
62 changed files with 685 additions and 469 deletions

32
corputils/auth_hooks.py Normal file
View 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()

View File

@@ -2,7 +2,6 @@
{% load i18n %}
{% load humanize %}
{% load bootstrap_pagination %}
{% load eveonline_extras %}
{% block member_data %}
{% if corpstats %}
<div class="row">