Skip to content

Commit

Permalink
Final fixes. Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Jan 24, 2024
1 parent 66d2b0e commit 55fc4db
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 64 deletions.
2 changes: 1 addition & 1 deletion lemarche/templates/tenders/_detail_cta.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h3>{{ tender.cta_card_title_text|safe }}</h3>
<p>{{ tender.cta_card_paragraph_text|safe }}</p>

{% if user_can_click %}
{% if tender_is_anonymous %}
{% if tender_response_is_anonymous %}
<form method="POST" action="{% url 'tenders:detail-contact-click-stat' tender.slug %}?siae_id={{ siae_id }}">
{% csrf_token %}
<button type="submit" class="btn btn-primary btn-block" name="detail_contact_click_confirm" value="true">{{ tender.cta_card_button_text|safe }}</button>
Expand Down
23 changes: 15 additions & 8 deletions lemarche/templates/tenders/_detail_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,36 @@
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 %}
{% 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 %}
{% endif %}
{% endif %}
<!-- anonymous user but siae_id in url -->
{% 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 %}
<!-- anonymous tender -->
{% 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 %}
Expand Down
10 changes: 4 additions & 6 deletions lemarche/templates/tenders/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@
{% if not tender.deadline_date_outdated and not tender.response_is_anonymous %}
{% if siae_has_detail_contact_click_date %}
<div class="row">
{% if not tender.response_is_anonymous %}
<div class="col-12 col-lg-8">
<div class="alert alert-info fade show" role="status">
{% include "tenders/_detail_contact.html" with tender=tender source="alert" %}
</div>
<div class="col-12 col-lg-8">
<div class="alert alert-info fade show" role="status">
{% include "tenders/_detail_contact.html" with tender=tender source="alert" %}
</div>
{% endif %}
</div>
<div class="col-12 col-lg-4">
<div class="alert alert-info mt-3 mt-lg-0" role="alert">
<p class="mb-1">
Expand Down
Loading

0 comments on commit 55fc4db

Please sign in to comment.