From b9c991df8b9fd353a8db1754aae7b4ecbabe15e3 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Mon, 22 Jan 2024 12:28:59 +0100 Subject: [PATCH] Tender detail: create sidebar template --- lemarche/templates/tenders/_detail_card.html | 2 + .../templates/tenders/_detail_sidebar.html | 77 +++++++++++++++++ .../tenders/_detail_success_contact.html | 6 +- lemarche/templates/tenders/detail.html | 84 +------------------ 4 files changed, 87 insertions(+), 82 deletions(-) create mode 100644 lemarche/templates/tenders/_detail_sidebar.html diff --git a/lemarche/templates/tenders/_detail_card.html b/lemarche/templates/tenders/_detail_card.html index 25fc853a0..d3ec24561 100644 --- a/lemarche/templates/tenders/_detail_card.html +++ b/lemarche/templates/tenders/_detail_card.html @@ -8,6 +8,7 @@ {% endif %}
+

@@ -32,6 +33,7 @@

{{ tender.sectors_list_string|safe }}

+ {% if not source_form %} {% if user.is_authenticated %} {% if user == tender.author %} diff --git a/lemarche/templates/tenders/_detail_sidebar.html b/lemarche/templates/tenders/_detail_sidebar.html new file mode 100644 index 000000000..dfea062b2 --- /dev/null +++ b/lemarche/templates/tenders/_detail_sidebar.html @@ -0,0 +1,77 @@ +{% 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 %} + {% 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 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 %} + + {% endif %} + {% comment %} infos for siaes {% endcomment %} + {% elif user.kind == user.KIND_SIAE %} + {% if not user.has_siae %} + + {% 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 %} + {% include "tenders/_detail_cta_not_interested.html" with tender=tender user_can_click=True %} + {% endif %} + {% endif %} + {% 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 %} + {% include "tenders/_detail_cta_not_interested.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 %} + {% include "tenders/_detail_cta_not_interested.html" with tender=tender user_can_click=False %} + {% endif %} + {% endif %} +{% endif %} diff --git a/lemarche/templates/tenders/_detail_success_contact.html b/lemarche/templates/tenders/_detail_success_contact.html index 9ab89b439..96dd0dfb3 100644 --- a/lemarche/templates/tenders/_detail_success_contact.html +++ b/lemarche/templates/tenders/_detail_success_contact.html @@ -2,7 +2,9 @@

Votre intérêt a été signalé au client

-

S’il est intéressé, il vous recontactera via vos coordonnées de contact présentes sur votre fiche commerciale (Vérifier votre fiche).

- +

+ S'il est intéressé, il vous recontactera via vos coordonnées de contact présentes sur + votre fiche commerciale (Vérifier votre fiche). +

diff --git a/lemarche/templates/tenders/detail.html b/lemarche/templates/tenders/detail.html index da01f709f..05dc5a3e3 100644 --- a/lemarche/templates/tenders/detail.html +++ b/lemarche/templates/tenders/detail.html @@ -27,7 +27,7 @@ {% block content %}
- {# Afficher les contacts en haut + conseil #} + {% if not tender.deadline_date_outdated and not tender.response_is_anonymous %} {% if siae_has_detail_contact_click_date %}
@@ -54,89 +54,13 @@ {% endif %} {% endif %}
- {# Main tender card #} +
{% include "tenders/_detail_card.html" with tender=tender %}
- {# Sidebar with actions #} +
- {% 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 %} - {% 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 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 %} - - {% endif %} - {% comment %} infos for siaes {% endcomment %} - {% elif user.kind == user.KIND_SIAE %} - {% if not user.has_siae %} - - {% 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 %} - {% include "tenders/_detail_cta_not_interested.html" with tender=tender user_can_click=True %} - {% endif %} - {% endif %} - {% 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 %} - {% include "tenders/_detail_cta_not_interested.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 %} - {% include "tenders/_detail_cta_not_interested.html" with tender=tender user_can_click=False %} - {% endif %} - {% endif %} - {% endif %} + {% include "tenders/_detail_sidebar.html" with tender=tender %}