Skip to content

Commit

Permalink
Tender detail: create sidebar template
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Jan 22, 2024
1 parent 1e55b0c commit b9c991d
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 82 deletions.
2 changes: 2 additions & 0 deletions lemarche/templates/tenders/_detail_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{% endif %}
</div>
<div class="card-body pb-5 px-5">
<!-- title & header -->
<div class="row py-4">
<div class="col-md-12">
<h1>
Expand All @@ -32,6 +33,7 @@ <h1>
{{ tender.sectors_list_string|safe }}
</div>
</div>
<!-- contact details -->
{% if not source_form %}
{% if user.is_authenticated %}
{% if user == tender.author %}
Expand Down
77 changes: 77 additions & 0 deletions lemarche/templates/tenders/_detail_sidebar.html
Original file line number Diff line number Diff line change
@@ -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 %}
<div class="alert alert-warning mt-3 mt-lg-0" role="alert">
<p class="mb-0 fs-sm">
Déjà {{ tender.siae_email_link_click_date_or_detail_display_date_count }} prestataire{{ tender.siae_email_link_click_date_or_detail_display_date_count|pluralize }} inclusif{{ tender.siae_email_link_click_date_or_detail_display_date_count|pluralize }}
{{ tender.siae_email_link_click_date_or_detail_display_date_count|pluralize:"a,ont" }} vu le besoin de ce client.
</p>
</div>
{% 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 %}
<div class="alert alert-info" role="alert">
<p class="mb-1">
<i class="ri-lightbulb-line ri-lg"></i>
<strong>Comment contacter le client ?</strong>
</p>
<p class="mb-0">
Contactez Sofiane via
<a href="mailto:{{ TEAM_CONTACT_EMAIL }}?subject=Demande d'information pour {{ tender.title }}">{{ TEAM_CONTACT_EMAIL }}</a>
pour être mis en relation avec le client.
</p>
</div>
{% endif %}
{% comment %} infos for siaes {% endcomment %}
{% elif user.kind == user.KIND_SIAE %}
{% if not user.has_siae %}
<div class="alert alert-info" role="alert">
<p class="mb-1">
<i class="ri-lightbulb-line ri-lg"></i>
<strong>Comment contacter le client ?</strong>
</p>
<p class="mb-0">
Pour accéder aux coordonnées du client, veuillez d'abord vous <a id="add-siae-btn" href="{% url 'dashboard_siaes:siae_search_by_siret' %}">rattacher à votre structure</a>.
</p>
<p>
Besoin d'aide ? contacter le support via le chat en ligne qui se trouve en bas à droite.
</p>
</div>
{% 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 %}
6 changes: 4 additions & 2 deletions lemarche/templates/tenders/_detail_success_contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<div class="card-body">
<h3>Votre intérêt a été signalé au client</h3>

<p>S’il est intéressé, il vous recontactera via vos coordonnées de contact présentes sur votre fiche commerciale (<a href="{% url 'dashboard:home' %}">Vérifier votre fiche</a>).</p>

<p>
S'il est intéressé, il vous recontactera via vos coordonnées de contact présentes sur
votre fiche commerciale (<a href="{% url 'dashboard:home' %}">Vérifier votre fiche</a>).
</p>
</div>
</div>
84 changes: 4 additions & 80 deletions lemarche/templates/tenders/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{% block content %}
<section class="s-section">
<div class="s-section__container container">
{# Afficher les contacts en haut + conseil #}
<!-- Contact details above + help -->
{% if not tender.deadline_date_outdated and not tender.response_is_anonymous %}
{% if siae_has_detail_contact_click_date %}
<div class="row">
Expand All @@ -54,89 +54,13 @@
{% endif %}
{% endif %}
<div class="row">
{# Main tender card #}
<!-- Main tender card -->
<div class="col-12 col-lg-8 order-2">
{% include "tenders/_detail_card.html" with tender=tender %}
</div>
{# Sidebar with actions #}
<!-- Sidebar with actions -->
<div class="col-12 col-lg-4 order-1 order-lg-2">
{% 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 %}
<div class="alert alert-warning mt-3 mt-lg-0" role="alert">
<p class="mb-0 fs-sm">
Déjà {{ tender.siae_email_link_click_date_or_detail_display_date_count }} prestataire{{ tender.siae_email_link_click_date_or_detail_display_date_count|pluralize }} inclusif{{ tender.siae_email_link_click_date_or_detail_display_date_count|pluralize }}
{{ tender.siae_email_link_click_date_or_detail_display_date_count|pluralize:"a,ont" }} vu le besoin de ce client.
</p>
</div>
{% 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 %}
<div class="alert alert-info" role="alert">
<p class="mb-1">
<i class="ri-lightbulb-line ri-lg"></i>
<strong>Comment contacter le client ?</strong>
</p>
<p class="mb-0">
Contactez Sofiane via
<a href="mailto:{{ TEAM_CONTACT_EMAIL }}?subject=Demande d'information pour {{ tender.title }}">{{ TEAM_CONTACT_EMAIL }}</a>
pour être mis en relation avec le client.
</p>
</div>
{% endif %}
{% comment %} infos for siaes {% endcomment %}
{% elif user.kind == user.KIND_SIAE %}
{% if not user.has_siae %}
<div class="alert alert-info" role="alert">
<p class="mb-1">
<i class="ri-lightbulb-line ri-lg"></i>
<strong>Comment contacter le client ?</strong>
</p>
<p class="mb-0">
Pour accéder aux coordonnées du client, veuillez d'abord vous <a id="add-siae-btn" href="{% url 'dashboard_siaes:siae_search_by_siret' %}">rattacher à votre structure</a>.
</p>
<p>
Besoin d'aide ? contacter le support via le chat en ligne qui se trouve en bas à droite.
</p>
</div>
{% 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 %}
</div>
</div>
</div>
Expand Down

0 comments on commit b9c991d

Please sign in to comment.