This commit is contained in:
Christoph Ladurner
2022-05-19 20:58:31 +02:00
parent c9ff126c28
commit 7c250a41fe

View File

@@ -16,11 +16,6 @@ from invenio_rdm_records.resources.serializers import UIJSONSerializer
from .search import FrontpageRecordsSearch 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( blueprint = Blueprint(
"invenio_theme_tugraz", "invenio_theme_tugraz",
__name__, __name__,
@@ -28,8 +23,6 @@ def ui_blueprint(app):
static_folder="static", 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") @blueprint.app_template_filter("make_dict_like")
def make_dict_like(value: str, key: str) -> Dict[str, str]: def make_dict_like(value: str, key: str) -> Dict[str, str]:
@@ -39,11 +32,20 @@ def ui_blueprint(app):
""" """
return {key: value} return {key: value}
@blueprint.app_template_filter("cast_to_dict") @blueprint.app_template_filter("cast_to_dict")
def cast_to_dict(attr_dict): def cast_to_dict(attr_dict):
"""Return the dict structure of AttrDict variable.""" """Return the dict structure of AttrDict variable."""
return AttrDict.to_dict(attr_dict) 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 return blueprint