mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Rewrite navigation as a class
Because we have multiple navigations, which will share the same methods (by subclassing) but different mappings of navigation items to endpoints by overriding the `.mapping` and `.exclude` attributes.
This commit is contained in:
@@ -36,9 +36,10 @@ from notifications_utils.formatters import formatted_list
|
||||
from werkzeug.exceptions import abort
|
||||
from werkzeug.local import LocalProxy
|
||||
|
||||
from app import proxy_fix, navigation
|
||||
from app import proxy_fix
|
||||
from app.config import configs
|
||||
from app.asset_fingerprinter import AssetFingerprinter
|
||||
from app.navigation import MainNavigation
|
||||
from app.notify_client.service_api_client import ServiceAPIClient
|
||||
from app.notify_client.api_key_api_client import ApiKeyApiClient
|
||||
from app.notify_client.invite_api_client import InviteApiClient
|
||||
@@ -89,6 +90,8 @@ current_service = LocalProxy(partial(_lookup_req_object, 'service'))
|
||||
# The current organisation attached to the request stack.
|
||||
current_organisation = LocalProxy(partial(_lookup_req_object, 'organisation'))
|
||||
|
||||
main_navigation = MainNavigation()
|
||||
|
||||
|
||||
def create_app(application):
|
||||
setup_commands(application)
|
||||
@@ -173,7 +176,7 @@ def init_app(application):
|
||||
|
||||
@application.context_processor
|
||||
def _nav_selected():
|
||||
return {'nav_selected': navigation.nav_selected}
|
||||
return {'main_navigation': main_navigation}
|
||||
|
||||
@application.before_request
|
||||
def record_start_time():
|
||||
|
||||
Reference in New Issue
Block a user