mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2025-12-24 05:31:57 +00:00
refactor
This commit is contained in:
@@ -16,11 +16,6 @@ from invenio_rdm_records.resources.serializers import UIJSONSerializer
|
||||
|
||||
from .search import FrontpageRecordsSearch
|
||||
|
||||
|
||||
def ui_blueprint(app):
|
||||
"""Blueprint for the routes and resources provided by Invenio-theme-tugraz."""
|
||||
routes = app.config.get("TUG_ROUTES")
|
||||
|
||||
blueprint = Blueprint(
|
||||
"invenio_theme_tugraz",
|
||||
__name__,
|
||||
@@ -28,8 +23,6 @@ def ui_blueprint(app):
|
||||
static_folder="static",
|
||||
)
|
||||
|
||||
blueprint.add_url_rule(routes["index"], view_func=index)
|
||||
blueprint.add_url_rule(routes["comingsoon"], view_func=comingsoon)
|
||||
|
||||
@blueprint.app_template_filter("make_dict_like")
|
||||
def make_dict_like(value: str, key: str) -> Dict[str, str]:
|
||||
@@ -39,11 +32,20 @@ def ui_blueprint(app):
|
||||
"""
|
||||
return {key: value}
|
||||
|
||||
|
||||
@blueprint.app_template_filter("cast_to_dict")
|
||||
def cast_to_dict(attr_dict):
|
||||
"""Return the dict structure of AttrDict variable."""
|
||||
return AttrDict.to_dict(attr_dict)
|
||||
|
||||
|
||||
def ui_blueprint(app):
|
||||
"""Blueprint for the routes and resources provided by Invenio-theme-tugraz."""
|
||||
routes = app.config.get("TUG_ROUTES")
|
||||
|
||||
blueprint.add_url_rule(routes["index"], view_func=index)
|
||||
blueprint.add_url_rule(routes["comingsoon"], view_func=comingsoon)
|
||||
|
||||
return blueprint
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user