mirror of
https://github.com/Cian-H/am-d-model.eu.git
synced 2025-12-22 21:41:57 +00:00
Another attempt to fix plugin
This commit is contained in:
@@ -1,15 +1,14 @@
|
|||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
|
|
||||||
blueprint = Blueprint(
|
|
||||||
"custom_menu",
|
|
||||||
__name__,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def init_app(app):
|
def init_app(app):
|
||||||
"""Initialize application."""
|
"""Initialize application."""
|
||||||
app.register_blueprint(blueprint)
|
|
||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
|
app.register_blueprint(views.blueprint)
|
||||||
|
|
||||||
|
@app.before_first_request
|
||||||
|
def init_menus():
|
||||||
|
views.init_menu()
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ blueprint = Blueprint(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@blueprint.before_app_first_request
|
|
||||||
def init_menu():
|
def init_menu():
|
||||||
"""Add custom items to main menu."""
|
"""Add custom items to main menu."""
|
||||||
current_menu.submenu("main").register(
|
current_menu.submenu("main").register(
|
||||||
@@ -18,6 +17,11 @@ def init_menu():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@blueprint.before_app_first_request
|
||||||
|
def init_menu_on_request():
|
||||||
|
init_menu()
|
||||||
|
|
||||||
|
|
||||||
@blueprint.route("/debug-menu")
|
@blueprint.route("/debug-menu")
|
||||||
def debug_menu():
|
def debug_menu():
|
||||||
"""Debug endpoint to view menu structure."""
|
"""Debug endpoint to view menu structure."""
|
||||||
|
|||||||
Reference in New Issue
Block a user