From 420e7e2fc14cfd9201684943ad795dab83727ce1 Mon Sep 17 00:00:00 2001 From: anonymous <anonymous> Date: Wed, 22 May 2019 14:36:13 +0200 Subject: [PATCH] backport of bugfix for master access --- ckanext/odsh/helpers.py | 4 ++++ ckanext/odsh/plugin.py | 3 ++- ckanext/odsh/templates/base.html | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ckanext/odsh/helpers.py b/ckanext/odsh/helpers.py index 12e9aebb..d7b0d5e5 100644 --- a/ckanext/odsh/helpers.py +++ b/ckanext/odsh/helpers.py @@ -211,3 +211,7 @@ def odsh_has_more_facets(facet, limit=None, exclude_active=False): if limit is not None and len(facets) > limit: return True return False + + +def odsh_public_url(): + return config.get('ckanext.odsh.public_url') diff --git a/ckanext/odsh/plugin.py b/ckanext/odsh/plugin.py index e80acd41..36e9e367 100644 --- a/ckanext/odsh/plugin.py +++ b/ckanext/odsh/plugin.py @@ -288,7 +288,8 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm 'presorted_license_options': odsh_helpers.presorted_license_options, 'odsh_tracking_id': odsh_helpers.odsh_tracking_id, 'odsh_tracking_url': odsh_helpers.odsh_tracking_url, - 'odsh_has_more_facets': odsh_helpers.odsh_has_more_facets + 'odsh_has_more_facets': odsh_helpers.odsh_has_more_facets, + 'odsh_public_url': odsh_helpers.odsh_public_url } def after_map(self, map): diff --git a/ckanext/odsh/templates/base.html b/ckanext/odsh/templates/base.html index 86fea0fc..636ba6d2 100644 --- a/ckanext/odsh/templates/base.html +++ b/ckanext/odsh/templates/base.html @@ -28,5 +28,6 @@ </script> <!-- End Matomo Code --> {% endblock %} +{% block bodytag %} data-site-root="{{ h.odsh_public_url }}" data-locale-root="{{ h.odsh_public_url }}" {% endblock %} {% block page %} {% endblock %} \ No newline at end of file -- GitLab