From dcbc3c875a56a1837b824a16cef128c6aa76391a Mon Sep 17 00:00:00 2001 From: Greg Kempe Date: Mon, 19 Feb 2024 15:18:52 +0200 Subject: [PATCH] make matomo configurable via ui --- .../templates/peachjam/layouts/main.html | 20 ------------------- .../templates/peachjam/layouts/main.html | 20 ------------------- peachjam/models/settings.py | 14 +++++++++++++ peachjam/templates/peachjam/layouts/main.html | 16 +++++++++++++++ 4 files changed, 30 insertions(+), 40 deletions(-) diff --git a/africanlii/templates/peachjam/layouts/main.html b/africanlii/templates/peachjam/layouts/main.html index af6f29d5e..fe7b727ab 100644 --- a/africanlii/templates/peachjam/layouts/main.html +++ b/africanlii/templates/peachjam/layouts/main.html @@ -5,23 +5,3 @@ href="{% sass_src 'stylesheets/africanlii.scss' %}" type="text/css"/> {% endblock %} -{% block head-js %} - {{ block.super }} - - - -{% endblock %} diff --git a/lawlibrary/templates/peachjam/layouts/main.html b/lawlibrary/templates/peachjam/layouts/main.html index 309d67338..b8181b3f1 100644 --- a/lawlibrary/templates/peachjam/layouts/main.html +++ b/lawlibrary/templates/peachjam/layouts/main.html @@ -5,23 +5,3 @@ href="{% sass_src 'stylesheets/lawlibrary.scss' %}" type="text/css"/> {% endblock %} -{% block head-js %} - {{ block.super }} - - - -{% endblock %} diff --git a/peachjam/models/settings.py b/peachjam/models/settings.py index 31dc3f0fc..18709fd51 100644 --- a/peachjam/models/settings.py +++ b/peachjam/models/settings.py @@ -109,6 +109,20 @@ class PeachJamSettings(SingletonModel): blank=True, help_text=_("Enter one or more email addresses separated by spaces."), ) + matomo_domain = models.CharField( + verbose_name=_("matomo domain"), + max_length=1024, + null=True, + blank=True, + help_text=_("Matomo domain (e.g. mysite.matomo.cloud)"), + ) + matomo_site_id = models.CharField( + verbose_name=_("matomo site ID"), + max_length=10, + null=True, + blank=True, + help_text=_("Matomo site ID (e.g. 2)"), + ) class Meta: verbose_name = verbose_name_plural = _("site settings") diff --git a/peachjam/templates/peachjam/layouts/main.html b/peachjam/templates/peachjam/layouts/main.html index d79a266da..0b9ba27cd 100644 --- a/peachjam/templates/peachjam/layouts/main.html +++ b/peachjam/templates/peachjam/layouts/main.html @@ -34,6 +34,22 @@ }); {% endif %} + {% if PEACHJAM_SETTINGS.matomo_domain and PEACHJAM_SETTINGS.matomo_site_id %} + + {% endif %} {% endif %}