Add getting started self guided help system for missing user setup
This commit is contained in:
@@ -1 +1 @@
|
||||
from .classes import FrontPageButton # NOQA
|
||||
from .classes import FrontPageButton, MissingItem # NOQA
|
||||
|
||||
@@ -8,3 +8,19 @@ class FrontPageButton(object):
|
||||
def __init__(self, link):
|
||||
self.link = link
|
||||
self.__class__._registry.append(link)
|
||||
|
||||
|
||||
class MissingItem(object):
|
||||
_registry = []
|
||||
|
||||
@classmethod
|
||||
def get_all(cls):
|
||||
return cls._registry
|
||||
|
||||
def __init__(self, label, condition, description, view):
|
||||
self.label = label
|
||||
self.condition = condition
|
||||
self.description = description
|
||||
self.view = view
|
||||
self.__class__._registry.append(self)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from dynamic_search.classes import SearchModel
|
||||
from permissions.models import Permission
|
||||
|
||||
from .api import diagnostics, tools
|
||||
from .classes import FrontPageButton
|
||||
from .classes import FrontPageButton, MissingItem
|
||||
|
||||
|
||||
def home(request):
|
||||
@@ -20,6 +20,7 @@ def home(request):
|
||||
'query_string': request.GET,
|
||||
'hide_links': True,
|
||||
'search_results_limit': 100,
|
||||
'missing_list': [item for item in MissingItem.get_all() if item.condition()],
|
||||
}
|
||||
|
||||
if request.GET:
|
||||
|
||||
Reference in New Issue
Block a user