From 19cfbbe1926395a33822cdf7d6a07cac1aed1ffa Mon Sep 17 00:00:00 2001 From: vasileios Date: Fri, 3 Feb 2023 16:03:14 +0100 Subject: [PATCH] [#1088] Added snippet to frontend --- src/open_inwoner/configurations/models.py | 2 +- src/open_inwoner/templates/analytics/siteimprove.html | 9 +++++++++ src/open_inwoner/templates/master.html | 1 + src/open_inwoner/utils/context_processors.py | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 src/open_inwoner/templates/analytics/siteimprove.html diff --git a/src/open_inwoner/configurations/models.py b/src/open_inwoner/configurations/models.py index 6b77e8a25d..74d4fb203e 100644 --- a/src/open_inwoner/configurations/models.py +++ b/src/open_inwoner/configurations/models.py @@ -441,7 +441,7 @@ def matomo_enabled(self): @property def siteimprove_enabled(self): - return True if self.siteimprove_id else False + return bool(self.siteimprove_id) def get_help_text(self, request): current_path = request.get_full_path() diff --git a/src/open_inwoner/templates/analytics/siteimprove.html b/src/open_inwoner/templates/analytics/siteimprove.html new file mode 100644 index 0000000000..5bf16e7442 --- /dev/null +++ b/src/open_inwoner/templates/analytics/siteimprove.html @@ -0,0 +1,9 @@ +{% load utils %} + +{% if siteimprove_enabled %} + +{% endif %} diff --git a/src/open_inwoner/templates/master.html b/src/open_inwoner/templates/master.html index 66927521fc..657ea7058c 100644 --- a/src/open_inwoner/templates/master.html +++ b/src/open_inwoner/templates/master.html @@ -27,6 +27,7 @@ {% include "analytics/google.html" %} {% include "analytics/matomo.html" %} + {% include "analytics/siteimprove.html" %} diff --git a/src/open_inwoner/utils/context_processors.py b/src/open_inwoner/utils/context_processors.py index 0de9c7af64..367fe93a83 100644 --- a/src/open_inwoner/utils/context_processors.py +++ b/src/open_inwoner/utils/context_processors.py @@ -72,6 +72,8 @@ def settings(request): "matomo_url": config.matomo_url, "matomo_site_id": config.matomo_site_id, "matomo_enabled": config.matomo_enabled, + "siteimprove_id": config.siteimprove_id, + "siteimprove_enabled": config.siteimprove_enabled, "show_plans": config.show_plans, "show_actions": config.show_actions, "menu_categories": Category.get_root_nodes().published(),