mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 18:37:33 -04:00
Merge pull request #2033 from alphagov/selected-nav
Highlight selected navigation item
This commit is contained in:
@@ -39,6 +39,7 @@ from werkzeug.local import LocalProxy
|
||||
from app import proxy_fix
|
||||
from app.config import configs
|
||||
from app.asset_fingerprinter import AssetFingerprinter
|
||||
from app.navigation import HeaderNavigation, MainNavigation, OrgNavigation
|
||||
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,12 @@ current_service = LocalProxy(partial(_lookup_req_object, 'service'))
|
||||
# The current organisation attached to the request stack.
|
||||
current_organisation = LocalProxy(partial(_lookup_req_object, 'organisation'))
|
||||
|
||||
navigation = {
|
||||
'main_navigation': MainNavigation(),
|
||||
'header_navigation': HeaderNavigation(),
|
||||
'org_navigation': OrgNavigation(),
|
||||
}
|
||||
|
||||
|
||||
def create_app(application):
|
||||
setup_commands(application)
|
||||
@@ -171,6 +178,10 @@ def init_app(application):
|
||||
def _attach_current_user():
|
||||
return{'current_user': current_user}
|
||||
|
||||
@application.context_processor
|
||||
def _nav_selected():
|
||||
return navigation
|
||||
|
||||
@application.before_request
|
||||
def record_start_time():
|
||||
g.start = monotonic()
|
||||
|
||||
Reference in New Issue
Block a user