From 9278b4735b97c577e2a808a31a408296e4e78c68 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Thu, 28 Sep 2023 10:39:28 +0200 Subject: [PATCH] =?UTF-8?q?[D=C3=A9p=C3=B4t=20de=20besoin]=20Rajouter=20un?= =?UTF-8?q?=20message=20pour=20les=20besoins=20en=20provenance=20d'APProch?= =?UTF-8?q?=20(#923)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Tender: if author is Approch, then add message above external link * Improve message display --- config/settings/base.py | 5 ++++- lemarche/templates/tenders/_detail_contact.html | 15 ++++++++++++++- lemarche/utils/settings_context_processors.py | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index 1fe8f8f88..388030cfc 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -398,6 +398,7 @@ HUBSPOT_API_KEY = env.str("HUBSPOT_API_KEY", "set-it") HUBSPOT_IS_ACTIVATED = env.bool("HUBSPOT_IS_ACTIVATED", False) + # Security # ------------------------------------------------------------------------------ @@ -771,7 +772,7 @@ } -# External URLs +# Internal & external # (if you need these settings in the template, add them to settings_context_processor.expose_settings) # ------------------------------------------------------------------------------ @@ -784,6 +785,7 @@ "https://docs.google.com/forms/d/e/1FAIpQLScx1k-UJ-962_rSgPJGabc327gGjFUho6ypgcZHCubuwTl7Lg/viewform" ) TALLY_NPS_FORM_ID = env.str("TALLY_NPS_FORM_ID", "") +APPROCH_USER_ID = env.int("APPROCH_USER_ID", 0) # Misc @@ -837,6 +839,7 @@ ] FORM_RENDERER = "django.forms.renderers.TemplatesSetting" + # MTCAPTCHA # ------------------------------------------------------------------------------ MTCAPTCHA_PRIVATE_KEY = env.str("MTCAPTCHA_PRIVATE_KEY", "") diff --git a/lemarche/templates/tenders/_detail_contact.html b/lemarche/templates/tenders/_detail_contact.html index 1b040695b..14e4aaaff 100644 --- a/lemarche/templates/tenders/_detail_contact.html +++ b/lemarche/templates/tenders/_detail_contact.html @@ -40,11 +40,24 @@

{% endif %} + {% if tender.can_display_contact_external_link %}
+ {% if tender.author.id == APPROCH_USER_ID %} +

+ Ce projet d'achat a été publié sur la plateforme APProch. +
+ Pour plus d'informations, pour être informé des mises à jour sur ce projet + ou pour indiquer votre intérêt auprès de l'acheteur public, cliquez sur le lien ci-dessous. +

+ {% endif %} - {{ tender.external_link_title|safe }} + {% if tender.author.id == APPROCH_USER_ID %} + Ça m'intéresse + {% else %} + {{ tender.external_link_title|safe }} + {% endif %}
diff --git a/lemarche/utils/settings_context_processors.py b/lemarche/utils/settings_context_processors.py index e5b96b813..b371d685c 100644 --- a/lemarche/utils/settings_context_processors.py +++ b/lemarche/utils/settings_context_processors.py @@ -22,6 +22,7 @@ def expose_settings(request): "CONTACT_EMAIL": settings.CONTACT_EMAIL, "TEAM_CONTACT_EMAIL": settings.TEAM_CONTACT_EMAIL, "GIP_CONTACT_EMAIL": settings.GIP_CONTACT_EMAIL, + "APPROCH_USER_ID": settings.APPROCH_USER_ID, # forms & docs "FACILITATOR_SLIDE": settings.FACILITATOR_SLIDE, "FACILITATOR_LIST": settings.FACILITATOR_LIST,