diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/country/country.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/country/country.html index 496d466b78..06c6111da1 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/country/country.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/country/country.html @@ -9,6 +9,11 @@ {{ data.country_dict.display_name }} {% endblock %} +{% block links %} + + {{ super() }} +{% endblock %} + {% block crisis_map %} {% block crisis_actions %} {% endblock %} diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/country/custom_country.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/country/custom_country.html index c0bd840ce7..db0c2d8c01 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/country/custom_country.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/country/custom_country.html @@ -17,6 +17,12 @@ {% endif %} {% endblock %} + +{% block links %} + + {{ super() }} +{% endblock %} + {% block breadcrumb_content %} {% snippet "snippets/other_breadcrumb_item.html", title=_('Groups'), controller='group', action='index', position=2 %} {% endblock %} diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/read_base.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/read_base.html index d510685c0e..4eec3f7fcb 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/read_base.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/read_base.html @@ -37,6 +37,7 @@ {% endblock %} {% block links %} + {{ super() }} {% if 'country_dict' in org_dict %} {% set group_dict = org_dict %} diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/pages/read_page.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/pages/read_page.html index 7d4c5df37f..f04d84b861 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/pages/read_page.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/pages/read_page.html @@ -5,6 +5,11 @@ {% block subtitle %}{{ data.title or data.name }}{% endblock %} +{% block links %} + + {{ super() }} +{% endblock %} + {% block breadcrumb_content %} {% if data.type == 'event' %} diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/util/light_redirect.py b/ckanext-hdx_theme/ckanext/hdx_theme/util/light_redirect.py index f5663f9b7c..71201b412b 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/util/light_redirect.py +++ b/ckanext-hdx_theme/ckanext/hdx_theme/util/light_redirect.py @@ -107,5 +107,24 @@ def switch_url_path(path=None, force=True): new_path = urlparse.urlunparse( parsed_url[0:4] + (query + force_query,) + parsed_url[5:] ) + else: + parsed_url = urlparse.urlparse(new_path) + query_params = urlparse.parse_qs(parsed_url.query, True) + + if FORCE_REDIRECT_URL_PARAM in query_params: + del query_params[FORCE_REDIRECT_URL_PARAM] + + # Reconstruct the URL + new_query = urlparse.urlencode(query_params, doseq=True) + new_url = urlparse.urlunparse(( + parsed_url.scheme, + parsed_url.netloc, + parsed_url.path, + parsed_url.params, + new_query, + parsed_url.fragment + )) + + new_path = new_url return new_path