Skip to content

Commit

Permalink
update messages for anonymous tenders
Browse files Browse the repository at this point in the history
  • Loading branch information
madjid-asa committed Oct 31, 2023
1 parent 66e8317 commit a73704a
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 55 deletions.
52 changes: 52 additions & 0 deletions lemarche/templates/tenders/_detail_side_infos_author.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{% if tender.is_draft %}
<div class="alert alert-warning fade show" role="status">
<div class="row">
<div class="col-auto pr-0">
<i class="ri-information-line ri-xl text-warning"></i>
</div>
<div class="col">
<p class="mb-0">Votre {{ tender_kind_display|default:tender.get_kind_display }} est encore en brouillon. Modifiez-le pour le publier.</p>
</div>
</div>
</div>
<a href="{% url 'tenders:update' tender.slug %}" class="btn btn-primary btn-ico">
<i class="ri-pencil-fill ri-lg font-weight-normal" aria-hidden="true"></i>
<span>Modifier</span>
</a>
{% endif %}
{% if tender.is_pending_validation %}
<div class="alert alert-info fade show" role="status">
<div class="row">
<div class="col-auto pr-0">
<i class="ri-information-line ri-xl text-info"></i>
</div>
<div class="col">
<p class="mb-0">Votre {{ tender_kind_display|default:tender.get_kind_display }} est en cours de validation.</p>
</div>
</div>
</div>
{% endif %}
{% if tender.is_validated %}
<div class="alert alert-success fade show" role="status">
<div class="row">
<div class="col-auto pr-0">
<i class="ri-checkbox-circle ri-xl text-info"></i>
</div>
<div class="col">
<p class="mb-0">Votre {{ tender_kind_display|default:tender.get_kind_display }} est validé et envoyé !</p>
</div>
</div>
</div>
<a href="{% url 'tenders:detail-siae-list' tender.slug %}" id="show-tender-siae-list-from-detail-btn" class="btn btn-primary mb-3">
<i class="ri-focus-2-line"></i>
{{ tender.siae_email_send_date_count }} prestataire{{ tender.siae_email_send_date_count|pluralize }} ciblé{{ tender.siae_email_send_date_count|pluralize }}
</a>
<a href="{% url 'tenders:detail-siae-list' tender.slug "VIEWED" %}" id="show-tender-siae-list-from-detail-btn" class="btn btn-primary mb-3">
<i class="ri-focus-2-line"></i>
{{ 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
</a>
<a href="{% url 'tenders:detail-siae-list' tender.slug "INTERESTED" %}" id="show-tender-siae-interested-list-from-detail-btn" class="btn btn-primary mb-3">
<i class="ri-thumb-up-line"></i>
{{ 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 }}
</a>
{% endif %}
70 changes: 15 additions & 55 deletions lemarche/templates/tenders/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<section class="s-section">
<div class="s-section__container container">
{# Afficher les contacts en haut + conseil #}
{% if not tender.deadline_date_outdated %}
{% if not tender.deadline_date_outdated and not tender.response_is_anonymous %}
{% if user_siae_has_detail_contact_click_date or siae_has_detail_contact_click_date %}
<div class="row">
<div class="col-12 col-lg-8">
Expand Down Expand Up @@ -58,64 +58,16 @@
</div>
{# 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 %}
{% if tender.is_draft %}
<div class="alert alert-warning fade show" role="status">
<div class="row">
<div class="col-auto pr-0">
<i class="ri-information-line ri-xl text-warning"></i>
</div>
<div class="col">
<p class="mb-0">Votre {{ tender_kind_display|default:tender.get_kind_display }} est encore en brouillon. Modifiez-le pour le publier.</p>
</div>
</div>
</div>
<a href="{% url 'tenders:update' tender.slug %}" class="btn btn-primary btn-ico">
<i class="ri-pencil-fill ri-lg font-weight-normal" aria-hidden="true"></i>
<span>Modifier</span>
</a>
{% endif %}
{% if tender.is_pending_validation %}
<div class="alert alert-info fade show" role="status">
<div class="row">
<div class="col-auto pr-0">
<i class="ri-information-line ri-xl text-info"></i>
</div>
<div class="col">
<p class="mb-0">Votre {{ tender_kind_display|default:tender.get_kind_display }} est en cours de validation.</p>
</div>
</div>
</div>
{% endif %}
{% if tender.is_validated %}
<div class="alert alert-success fade show" role="status">
<div class="row">
<div class="col-auto pr-0">
<i class="ri-checkbox-circle ri-xl text-info"></i>
</div>
<div class="col">
<p class="mb-0">Votre {{ tender_kind_display|default:tender.get_kind_display }} est validé et envoyé !</p>
</div>
</div>
</div>
<a href="{% url 'tenders:detail-siae-list' tender.slug %}" id="show-tender-siae-list-from-detail-btn" class="btn btn-primary mb-3">
<i class="ri-focus-2-line"></i>
{{ tender.siae_email_send_date_count }} prestataire{{ tender.siae_email_send_date_count|pluralize }} ciblé{{ tender.siae_email_send_date_count|pluralize }}
</a>
<a href="{% url 'tenders:detail-siae-list' tender.slug "VIEWED" %}" id="show-tender-siae-list-from-detail-btn" class="btn btn-primary mb-3">
<i class="ri-focus-2-line"></i>
{{ 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
</a>
<a href="{% url 'tenders:detail-siae-list' tender.slug "INTERESTED" %}" id="show-tender-siae-interested-list-from-detail-btn" class="btn btn-primary mb-3">
<i class="ri-thumb-up-line"></i>
{{ 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 }}
</a>
{% 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 %}
<div class="alert alert-warning mt-3 mt-lg-0" role="alert">
<p class="mb-0 fs-sm">
Expand All @@ -124,7 +76,8 @@
</p>
</div>
{% 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 %}
<div class="alert alert-info" role="alert">
Expand All @@ -139,6 +92,7 @@
</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">
Expand All @@ -158,13 +112,19 @@
{% 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 user.is_authenticated) %}
{% if not siae_has_detail_contact_click_date %}
{% include "tenders/_detail_cta.html" with tender=tender user_can_click=False %}
{% endif %}
{% else %}
{% include "tenders/_detail_cta.html" with tender=tender user_can_click=False %}
{% endif %}
Expand Down
2 changes: 2 additions & 0 deletions lemarche/tenders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,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
Expand Down

0 comments on commit a73704a

Please sign in to comment.