diff --git a/oarepo_ui/ext.py b/oarepo_ui/ext.py index db1d50b5..b0c13202 100644 --- a/oarepo_ui/ext.py +++ b/oarepo_ui/ext.py @@ -35,7 +35,6 @@ def _catalog_config(self, catalog, env): catalog.jinja_env.filters.update(env.filters) catalog.jinja_env.policies.update(env.policies) - # env.loader.searchpath = list_templates(catalog.jinja_env) catalog.prefixes[""] = catalog.jinja_env.loader return catalog diff --git a/oarepo_ui/resources/catalog.py b/oarepo_ui/resources/catalog.py index 0bcfb064..953aef0e 100644 --- a/oarepo_ui/resources/catalog.py +++ b/oarepo_ui/resources/catalog.py @@ -105,23 +105,6 @@ def _get_component_path( raise ComponentNotFound(f"Unable to find a file named {name}") - def _get_from_file( - self, *, prefix: str, name: str, url_prefix: str, file_ext: str - ) -> "Component": - return super()._get_from_file( - prefix=prefix, name=name, url_prefix=url_prefix, file_ext=file_ext - ) - root_path, path = self._get_component_path(prefix, name, file_ext=file_ext) - component = Component( - name=name, - url_prefix=url_prefix, - path=path, - ) - tmpl_name = str(path.relative_to(root_path)) - - component.tmpl = self.jinja_env.get_template(tmpl_name) - return component - def list_templates(self): searchpath = [] @@ -149,16 +132,6 @@ def list_templates(self): return searchpath -def lazy_string_encoder(obj): - if isinstance(obj, list): - return [lazy_string_encoder(item) for item in obj] - elif isinstance(obj, dict): - return {key: lazy_string_encoder(value) for key, value in obj.items()} - else: - return str(obj) - - - def strip_app_theme(template_name, app_theme): if app_theme: for theme in app_theme: