diff --git a/ckanext-hdx_crisis/ckanext/hdx_crisis/controllers/custom_location_controller.py b/ckanext-hdx_crisis/ckanext/hdx_crisis/controllers/custom_location_controller.py index 53f07cd233..6f55706fb4 100644 --- a/ckanext-hdx_crisis/ckanext/hdx_crisis/controllers/custom_location_controller.py +++ b/ckanext-hdx_crisis/ckanext/hdx_crisis/controllers/custom_location_controller.py @@ -96,6 +96,7 @@ def generate_template_data(self, id, group_info, custom_dict): template_data = { 'data': { + 'country_id': group_info['id'], 'country_name': group_info['name'], 'country_title': group_info.get('title', group_info['name']), 'topline_chart_sections': self._create_sections(top_line_items, charts_config_data), 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 adfbe9613c..9d7a8b6281 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/country/country.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/country/country.html @@ -1,5 +1,9 @@ {% extends "crisis/crisis-base.html" %} +{# The lines below are for analytics #} +{% block analytics_group_names %}['{{ c.group_dict.name }}']{% endblock %} +{% block analytics_group_ids %}['{{ c.group_dict.id }}']{% endblock %} + {% block subtitle %} {{ c.group_dict.display_name }} {% 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 39ea417b23..901f0a0e7d 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 @@ -1,5 +1,9 @@ {% extends "crisis/crisis-base.html" %} +{# The lines below are for analytics #} +{% block analytics_group_names %}['{{ data.country_name }}']{% endblock %} +{% block analytics_group_ids %}['{{ data.country_id }}']{% endblock %} + {% block subtitle %}{{ data.country_title }}{% endblock %} {% block crisis_title %} {{ data.country_title }} {% endblock %} {% block crisis_actions %} diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/custom/custom_org.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/custom/custom_org.html index c0b980a5fb..0aeec0fd88 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/custom/custom_org.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/custom/custom_org.html @@ -1,5 +1,9 @@ {% extends "page.html" %} +{# The lines below are for analytics #} +{% block analytics_org_name %}{{ data.org_info.name }}{% endblock %} +{% block analytics_org_id %}{{ data.org_info.id }}{% endblock %} + {% block subtitle %}{{ data.org_info.display_name }}{% endblock %} {% block breadcrumb_content %} diff --git a/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/read.html b/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/read.html index dd6c87bbbf..14026bbbeb 100644 --- a/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/read.html +++ b/ckanext-hdx_theme/ckanext/hdx_theme/templates/organization/read.html @@ -1,5 +1,9 @@ {% extends "organization/read_base.html" %} +{# The lines below are for analytics #} +{% block analytics_org_name %}{{ c.group_dict.name }}{% endblock %} +{% block analytics_org_id %}{{ c.group_dict.id }}{% endblock %} + {% set can_create_dataset = h.check_access('package_create', {'organization_id': c.group_dict.id, 'owner_org': c.group_dict.id}) %} {% set can_edit = h.check_access('organization_update', {'id': c.group_dict.id}) %} {% set can_actions = can_create_dataset or can_edit %}