From 9d83c4e02f4f82de1b532b7f50d05818502bdb0d Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Tue, 26 Sep 2023 17:32:53 +0200 Subject: [PATCH 1/2] Tender: if author is Approch, then add message above external link --- config/settings/base.py | 5 ++++- lemarche/templates/tenders/_detail_contact.html | 7 +++++++ lemarche/utils/settings_context_processors.py | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config/settings/base.py b/config/settings/base.py index 1fe8f8f88..ae8cb278b 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.str("APPROCH_USER_ID", "") # 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..4027f19a4 100644 --- a/lemarche/templates/tenders/_detail_contact.html +++ b/lemarche/templates/tenders/_detail_contact.html @@ -43,6 +43,13 @@

{% 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 }} 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, From ae3f4c55e95ab60f82c4db14ac8bedf59d032ce1 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Thu, 28 Sep 2023 10:09:41 +0200 Subject: [PATCH 2/2] Improve message display --- config/settings/base.py | 2 +- lemarche/templates/tenders/_detail_contact.html | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index ae8cb278b..388030cfc 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -785,7 +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.str("APPROCH_USER_ID", "") +APPROCH_USER_ID = env.int("APPROCH_USER_ID", 0) # Misc diff --git a/lemarche/templates/tenders/_detail_contact.html b/lemarche/templates/tenders/_detail_contact.html index 4027f19a4..14e4aaaff 100644 --- a/lemarche/templates/tenders/_detail_contact.html +++ b/lemarche/templates/tenders/_detail_contact.html @@ -40,18 +40,24 @@

{% endif %}
+ {% if tender.can_display_contact_external_link %}