From 1cd902b1341ed0313cda36ea659711d4ff06e3b0 Mon Sep 17 00:00:00 2001 From: Fabien Le Frapper Date: Tue, 14 Jan 2025 18:56:37 +0100 Subject: [PATCH] Hide contact form on iframe --- core/context_processors.py | 1 + templates/components/sidebar/sidebar.html | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/context_processors.py b/core/context_processors.py index 112c7e9c7..aea8943fe 100644 --- a/core/context_processors.py +++ b/core/context_processors.py @@ -22,6 +22,7 @@ def content(request): def assistant(request) -> dict: return { "assistant": { + "is_iframe": "iframe" in request.GET, "is_home": request.path == reverse("qfdmd:home"), "POSTHOG_KEY": settings.ASSISTANT["POSTHOG_KEY"], "MATOMO_ID": settings.ASSISTANT["MATOMO_ID"], diff --git a/templates/components/sidebar/sidebar.html b/templates/components/sidebar/sidebar.html index 0921c5ff5..e4b278202 100644 --- a/templates/components/sidebar/sidebar.html +++ b/templates/components/sidebar/sidebar.html @@ -11,6 +11,8 @@ > {% include "./embed/action.html" %} {% include "./share/action.html" %} - {% include "./email/action.html" %} + {% if not assistant.is_iframe %} + {% include "./email/action.html" %} + {% endif %}