Skip to content

Commit

Permalink
fix tender detail display
Browse files Browse the repository at this point in the history
  • Loading branch information
madjid-asa committed Nov 12, 2024
1 parent ddec377 commit 66e7c0a
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 36 deletions.
8 changes: 8 additions & 0 deletions lemarche/static/itou_marche/itou_marche.scss
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,11 @@ ul.summary-grid-list {
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
padding: 8px;
}

.text-center {
text-align: center;
}

.bg-gray {
background-color: var(--g300);
}
12 changes: 5 additions & 7 deletions lemarche/templates/tenders/_closed_badge.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<span>
{% if tender.deadline_date_is_outdated_annotated %}
<p class="fr-badge fr-badge--sm">
{{ tender_kind_display|default:tender.get_kind_display }} clôturé{% if tender.kind == "QUOTE" %}e{% endif %}
{% if tender.deadline_date_is_outdated_annotated or tender.deadline_date_is_outdated %}
<p class="fr-badge fr-badge--sm fr-badge--warning">
{{ tender_kind_display|default:tender.get_kind_display }} clôturé
{% if tender.kind == "QUOTE" %}e{% endif %}
le {{ tender.deadline_date|default:"" }}
</p>
{% else %}
Expand All @@ -12,9 +13,6 @@
{{ tender.get_kind_display }}
{% endif %}
</p>
Disponible <strong>jusqu'au : {{ tender.deadline_date|default:"" }}</strong>
{% if is_new_for_siaes %}
<p class="fr-badge fr-badge--sm fr-badge--green-emeraude">Nouveau</p>
{% endif %}
{% if is_new_for_siaes %}<p class="fr-badge fr-badge--sm fr-badge--green-emeraude">Nouveau</p>{% endif %}
{% endif %}
</span>
56 changes: 27 additions & 29 deletions lemarche/templates/tenders/_detail_card.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
{% load static humanize %}

<div class="fr-card">
<div class="fr-card fr-mb-2w">
<div class="fr-card__body fr-py-4w">
<div class="fr-grid-row">
<div class="fr-col-md-12">
{% include "tenders/_closed_badge.html" with tender=tender is_new_for_siaes=is_new_for_siaes %}
</div>
</div>
<!-- title & header -->
<div class="fr-grid-row">
<div class="fr-col-md-12">
<h1>
{{ tender.title }}
</h1>
</div>
</div>
<div class="fr-grid-row text-bold">
<div class="fr-grid-row text-center bg-gray fr-text--xs fr-py-2w">
{% if tender.contact_company_name_display %}
<div class="fr-col-md-4" title="Entreprise">
<span class="fr-icon-building-line" aria-hidden="true"></span>
Expand All @@ -26,37 +12,49 @@ <h1>
<span class="fr-icon-map-pin-2-line" aria-hidden="true"></span>
{{ tender.location_display|safe }}
</div>
<div class="fr-col-md-4" title="Secteurs d'activité : {{ tender.sectors_full_list_string|safe }}">
<div class="fr-col-md-4"
title="Secteurs d'activité : {{ tender.sectors_full_list_string|safe }}">
<span class="fr-icon-award-line" aria-hidden="true"></span>
{{ tender.sectors_list_string|safe }}
</div>
</div>
<div class="fr-grid-row fr-py-2w">
<div class="fr-col-md-12">
{% include "tenders/_closed_badge.html" with tender=tender is_new_for_siaes=is_new_for_siaes %}
</div>
</div>
<!-- title & header -->
<div class="fr-grid-row">
<div class="fr-col-md-12">
<h1>{{ tender.title }}</h1>
</div>
</div>
<!-- contact details -->
{% if not source_form %}
{% if user.is_authenticated %}
{% if user == tender.author %}
<hr class="fr-my-4w">
<hr>
{% include "tenders/_detail_contact.html" with tender=tender %}
{% elif user_partner_can_display_tender_contact_details %}
<hr class="fr-my-4w">
<hr>
{% include "tenders/_detail_contact.html" with tender=tender %}
{% elif siae_has_detail_contact_click_date and not tender.deadline_date_outdated %}
<!-- for SIAE, contact details are displayed above (see tenders/detail.html) -->
{% endif %}
{% endif %}
{% endif %}
<!-- tender description -->
<hr class="fr-my-4w">
<h2>
Description
</h2>
{% if tender.start_working_date %}
<p class="fr-text--sm">Début d'intervention : {{ tender.start_working_date }}</p>
<p class="fr-text--sm">
Disponible <strong>jusqu'au {{ tender.deadline_date|default:"" }}</strong>
<br>
Début d'intervention : {{ tender.start_working_date }}
</p>
{% endif %}
<p>{{ tender.description|safe|linebreaks }}</p>
<p>{{ tender.description|safe }}</p>
<!-- tender questions -->
{% if source_form or not source_form and tender.questions_list|length %}
<hr class="fr-my-4w">
<hr>
<h2>
{% if source_form or user == tender.author %}
Questions à poser aux prestataires ciblés
Expand All @@ -70,13 +68,13 @@ <h2>
{% endif %}
<!-- tender constraints -->
{% if tender.constraints %}
<hr class="fr-my-4w">
<hr>
<h2>Comment répondre à cette demande ?</h2>
<p>{{ tender.constraints|default:"-"|safe|linebreaks }}</p>
<p>{{ tender.constraints|safe }}</p>
{% endif %}
<!-- tender amount -->
{% if source_form or user == tender.author or tender.accept_share_amount %}
<hr class="fr-my-4w">
<hr>
<h2>
{% if source_form or user == tender.author %}
Montant du marché
Expand Down
4 changes: 4 additions & 0 deletions lemarche/tenders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,10 @@ def get_admin_url(self):
def is_draft(self) -> bool:
return self.status == tender_constants.STATUS_DRAFT

@property
def deadline_date_is_outdated(self, limit_date=datetime.today().date()):
return self.deadline_date < limit_date

@property
def is_pending_validation(self) -> bool:
return self.status == tender_constants.STATUS_PUBLISHED
Expand Down

0 comments on commit 66e7c0a

Please sign in to comment.