+ {% comment %} admin info {% endcomment %}
{% if is_admin %}
{% include "tenders/_detail_admin_extra_info.html" with tender=tender %}
{% endif %}
+ {% comment %} details author {% endcomment %}
{% if user == tender.author %}
- {% if tender.is_draft %}
-
-
-
-
-
-
-
Votre {{ tender_kind_display|default:tender.get_kind_display }} est encore en brouillon. Modifiez-le pour le publier.
-
-
-
-
-
- Modifier
-
- {% endif %}
- {% if tender.is_pending_validation %}
-
-
-
-
-
-
-
Votre {{ tender_kind_display|default:tender.get_kind_display }} est en cours de validation.
-
-
-
- {% endif %}
- {% if tender.is_validated %}
-
-
-
-
-
-
-
Votre {{ tender_kind_display|default:tender.get_kind_display }} est validé et envoyé !
-
-
-
-
-
- {{ tender.siae_email_send_date_count }} prestataire{{ tender.siae_email_send_date_count|pluralize }} ciblé{{ tender.siae_email_send_date_count|pluralize }}
-
-
-
- {{ tender.siae_email_link_click_date_or_detail_display_date_count }} prestataire{{ tender.siae_email_link_click_date_or_detail_display_date_count|pluralize }} qui {{ tender.siae_email_link_click_date_or_detail_display_date_count|pluralize:'a,ont' }} vu
-
-
-
- {{ tender.siae_detail_contact_click_date_count }} prestataire{{ tender.siae_detail_contact_click_date_count|pluralize }} intéressé{{ tender.siae_detail_contact_click_date_count|pluralize }}
-
- {% endif %}
+ {% include "tenders/_detail_side_infos_author.html" %}
{% else %}
{% if not tender.deadline_date_outdated %}
+ {% comment %} stats of views {% endcomment %}
{% if tender.siae_email_link_click_date_or_detail_display_date_count > 0 %}
{% endif %}
- {% if user.is_authenticated %}
+ {% if user.is_authenticated and not tender.response_is_anonymous %}
+ {% comment %} infos for partner {% endcomment %}
{% if user.kind == user.KIND_PARTNER %}
{% if not user_partner_can_display_tender_contact_details %}
@@ -139,6 +94,7 @@
{% endif %}
+ {% comment %} infos for siaes {% endcomment %}
{% elif user.kind == user.KIND_SIAE %}
{% if not user.has_siae %}
@@ -153,18 +109,26 @@
Besoin d'aide ? contacter le support via le chat en ligne qui se trouve en bas à droite.
- {% elif not user_siae_has_detail_contact_click_date %}
+ {% elif not siae_has_detail_contact_click_date %}
{% include "tenders/_detail_cta.html" with tender=tender user_can_click=True %}
{% include "tenders/_detail_cta_cocontracting.html" with tender=tender %}
{% endif %}
{% endif %}
- {% elif siae_id %}
+ {% comment %} if siae_id {% endcomment %}
+ {% elif siae_id and not tender.response_is_anonymous %}
{% if not siae_has_detail_contact_click_date %}
{% include "tenders/_detail_cta.html" with tender=tender user_can_click=True siae_id=siae_id %}
{% include "tenders/_detail_cta_cocontracting.html" with tender=tender siae_id=siae_id %}
{% else %}
{% include "tenders/_detail_contact.html" with tender=tender %}
{% endif %}
+ {% comment %} for anonymous tenders {% endcomment %}
+ {% elif tender.response_is_anonymous and siae_id or tender.response_is_anonymous and user.is_authenticated %}
+ {% if not siae_has_detail_contact_click_date %}
+ {% include "tenders/_detail_cta.html" with tender=tender user_can_click=True tender_is_anonymous=True %}
+ {% else %}
+ {% include "tenders/_detail_success_contact.html" %}
+ {% endif %}
{% else %}
{% include "tenders/_detail_cta.html" with tender=tender user_can_click=False %}
{% endif %}
diff --git a/lemarche/tenders/admin.py b/lemarche/tenders/admin.py
index 8882e14ed..99197f88e 100644
--- a/lemarche/tenders/admin.py
+++ b/lemarche/tenders/admin.py
@@ -1,5 +1,6 @@
from ckeditor.widgets import CKEditorWidget
from django import forms
+from django.conf import settings
from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from django.db import models
@@ -488,7 +489,8 @@ def response_change(self, request, obj: Tender):
if request.POST.get("_validate_tender"):
update_and_send_tender_task(tender=obj)
self.message_user(request, "Ce dépôt de besoin a été validé et envoyé aux structures")
- api_hubspot.create_deal_from_tender(tender=obj)
+ if settings.BITOUBI_ENV == "prod":
+ api_hubspot.create_deal_from_tender(tender=obj)
return HttpResponseRedirect(".")
elif request.POST.get("_restart_tender"):
diff --git a/lemarche/tenders/models.py b/lemarche/tenders/models.py
index 184677fef..149d02be5 100644
--- a/lemarche/tenders/models.py
+++ b/lemarche/tenders/models.py
@@ -545,6 +545,8 @@ def cta_card_paragraph_text(self):
return "Accéder à l'appel d'offres afin d'y répondre."
elif self.kind == tender_constants.KIND_QUOTE:
return "Accéder aux coordonnées du client afin de lui envoyer un devis."
+ elif self.kind == tender_constants.KIND_PROJECT and self.response_is_anonymous:
+ return "Manifestez votre intérêt au client. S’il est intéressé, le client vous recontactera via les coordonnées présentes sur votre fiche commerciale." # noqa
elif self.kind == tender_constants.KIND_PROJECT:
return "Accéder aux coordonnées du client afin de lui présenter vos services et produits."
# just in case
@@ -554,6 +556,8 @@ def cta_card_paragraph_text(self):
def cta_card_button_text(self):
if self.kind == tender_constants.KIND_TENDER:
return "Voir l'appel d'offres"
+ elif self.kind == tender_constants.KIND_PROJECT and self.response_is_anonymous:
+ return "Je suis intéressé !"
return "Accéder aux coordonnées"
@cached_property
diff --git a/lemarche/www/tenders/views.py b/lemarche/www/tenders/views.py
index d72129349..fa25fc823 100644
--- a/lemarche/www/tenders/views.py
+++ b/lemarche/www/tenders/views.py
@@ -376,7 +376,7 @@ def get_context_data(self, **kwargs):
).exists()
if user.is_authenticated:
if user.kind == User.KIND_SIAE:
- context["user_siae_has_detail_contact_click_date"] = TenderSiae.objects.filter(
+ context["siae_has_detail_contact_click_date"] = TenderSiae.objects.filter(
tender=self.object, siae__in=user.siaes.all(), detail_contact_click_date__isnull=False
).exists()
if show_nps: