From 55fc4db4e0a7d70dd38ad5f1bc0562e96a837cbe Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Mon, 22 Jan 2024 13:09:11 +0100 Subject: [PATCH] Final fixes. Add tests --- ...confirm_tender_response_is_anonymous.html} | 0 lemarche/templates/tenders/_detail_cta.html | 2 +- .../templates/tenders/_detail_sidebar.html | 23 ++- lemarche/templates/tenders/detail.html | 10 +- lemarche/www/tenders/tests.py | 183 +++++++++++++----- lemarche/www/tenders/views.py | 9 + 6 files changed, 163 insertions(+), 64 deletions(-) rename lemarche/templates/tenders/{_detail_success_contact.html => _detail_contact_click_confirm_tender_response_is_anonymous.html} (100%) diff --git a/lemarche/templates/tenders/_detail_success_contact.html b/lemarche/templates/tenders/_detail_contact_click_confirm_tender_response_is_anonymous.html similarity index 100% rename from lemarche/templates/tenders/_detail_success_contact.html rename to lemarche/templates/tenders/_detail_contact_click_confirm_tender_response_is_anonymous.html diff --git a/lemarche/templates/tenders/_detail_cta.html b/lemarche/templates/tenders/_detail_cta.html index 3fa063cba..c692aadee 100644 --- a/lemarche/templates/tenders/_detail_cta.html +++ b/lemarche/templates/tenders/_detail_cta.html @@ -5,7 +5,7 @@

{{ tender.cta_card_title_text|safe }}

{{ tender.cta_card_paragraph_text|safe }}

{% if user_can_click %} - {% if tender_is_anonymous %} + {% if tender_response_is_anonymous %}
{% csrf_token %} diff --git a/lemarche/templates/tenders/_detail_sidebar.html b/lemarche/templates/tenders/_detail_sidebar.html index 1b2a981ec..257a033e8 100644 --- a/lemarche/templates/tenders/_detail_sidebar.html +++ b/lemarche/templates/tenders/_detail_sidebar.html @@ -49,7 +49,10 @@ Besoin d'aide ? contacter le support via le chat en ligne qui se trouve en bas à droite.

- {% elif not siae_has_detail_contact_click_date %} + {% elif siae_has_detail_contact_click_date %} + {% elif siae_has_detail_not_interested_click_date %} + {% include "tenders/_detail_not_interested_click_confirm.html" %} + {% else %} {% include "tenders/_detail_cta.html" with tender=tender user_can_click=True %} {% include "tenders/_detail_cta_cocontracting.html" with tender=tender %} {% include "tenders/_detail_cta_not_interested.html" with tender=tender user_can_click=True %} @@ -57,21 +60,25 @@ {% endif %} {% elif siae_id %} - {% if not siae_has_detail_contact_click_date %} + {% if siae_has_detail_contact_click_date %} + {% elif siae_has_detail_not_interested_click_date %} + {% include "tenders/_detail_not_interested_click_confirm.html" %} + {% else %} {% 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 %} - {% include "tenders/_detail_cta_not_interested.html" with tender=tender siae_id=siae_id %} - {% else %} - {% include "tenders/_detail_contact.html" with tender=tender %} + {% include "tenders/_detail_cta_not_interested.html" with tender=tender user_can_click=True siae_id=siae_id %} {% endif %} {% endif %} {% else %} {% if user.is_authenticated or siae_id %} - {% if not siae_has_detail_contact_click_date %} - {% include "tenders/_detail_cta.html" with tender=tender user_can_click=True tender_is_anonymous=True %} + {% if siae_has_detail_contact_click_date %} + {% include "tenders/_detail_contact_click_confirm_tender_response_is_anonymous.html" %} + {% elif siae_has_detail_not_interested_click_date %} + {% include "tenders/_detail_not_interested_click_confirm.html" %} {% else %} - {% include "tenders/_detail_success_contact.html" %} + {% include "tenders/_detail_cta.html" with tender=tender user_can_click=True siae_id=siae_id tender_response_is_anonymous=True %} + {% include "tenders/_detail_cta_not_interested.html" with tender=tender user_can_click=True siae_id=siae_id %} {% endif %} {% endif %} {% endif %} diff --git a/lemarche/templates/tenders/detail.html b/lemarche/templates/tenders/detail.html index 05dc5a3e3..42379f49c 100644 --- a/lemarche/templates/tenders/detail.html +++ b/lemarche/templates/tenders/detail.html @@ -31,13 +31,11 @@ {% if not tender.deadline_date_outdated and not tender.response_is_anonymous %} {% if siae_has_detail_contact_click_date %}
- {% if not tender.response_is_anonymous %} -
-
- {% include "tenders/_detail_contact.html" with tender=tender source="alert" %} -
+
+
+ {% include "tenders/_detail_contact.html" with tender=tender source="alert" %}
- {% endif %} +