mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 19:42:37 +02:00
Simpler home page
- remove category titles - we still show first open deliveries, ordered by dead line - passed but non archived delivery status label is "À solder"
This commit is contained in:
parent
049ef6260c
commit
132884385e
5 changed files with 7 additions and 7 deletions
|
@ -239,7 +239,9 @@ class Delivery(Base):
|
|||
|
||||
@classmethod
|
||||
def incoming(cls):
|
||||
return [d for d in cls.all() if d.is_foreseen]
|
||||
return sorted(
|
||||
[d for d in cls.all() if d.is_foreseen], key=lambda d: d.order_before
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def former(cls):
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
</li>
|
||||
{% if request.user and request.user.is_staff %}
|
||||
<li>
|
||||
<a href="/livraison/{{ delivery.id }}/exporter/produits"><i class="icon-layers"></i> Télécharger les produits</a>
|
||||
<a href="/livraison/{{ delivery.id }}/exporter/produits"><i class="icon-download"></i> Télécharger les produits</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/livraison/{{ delivery.id }}/edit"><i class="icon-adjustments"></i> Modifier la livraison</a>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<ul class="toolbox">
|
||||
{% if delivery.status == delivery.CLOSED %}
|
||||
<li>
|
||||
<a href="/livraison/{{ delivery.id }}/archiver" class="button danger"><i class="icon-hazardous"></i> Archiver</a>
|
||||
<a href="/livraison/{{ delivery.id }}/archiver" class="button danger"><i class="icon-layers"></i> Archiver</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
{% extends "base.html" %}
|
||||
{% block body %}
|
||||
<h2>Livraisons à venir</h2>
|
||||
{% with deliveries=incoming %}
|
||||
{% include "includes/delivery_list.html" %}
|
||||
{% endwith %}
|
||||
<h2>Livraisons passées</h2>
|
||||
{% with deliveries=former %}
|
||||
{% include "includes/delivery_list.html" %}
|
||||
{% endwith %}
|
||||
<a href="/archives">Voir les livraisons archivées</a>
|
||||
<a href="/archives"><i class="icon-layers"></i> Voir les livraisons archivées</a>
|
||||
{% endblock body %}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<li><i class="icon-streetsign"></i> <strong>Lieu</strong> {{ delivery.where }}</li>
|
||||
<li><i class="icon-strategy"></i> <strong>Référent</strong> <a href="mailto:{{ delivery.contact }}">{{ delivery.contact }}</a></li>
|
||||
<li><i class="icon-clock"></i> <strong>Date de livraison</strong> <time datetime="{{ delivery.from_date }}">{{ delivery.from_date|date }} de {{ delivery.from_date|time }} à {{ delivery.to_date|time }}</time></li>
|
||||
<li><i class="icon-hourglass"></i> {% if delivery.status == delivery.OPEN %}<strong>Date limite de commande</strong> <time datetime="{{ delivery.order_before.date() }}">{{ delivery.order_before|date }}</time>{% elif delivery.status == delivery.ADJUSTMENT %}<strong>Ajustement en cours</strong>{% elif delivery.status == delivery.CLOSED %}<strong>Fermée</strong>{% else %}<strong>Archivée</strong>{% endif %}</li>
|
||||
<li><i class="icon-hourglass"></i> {% if delivery.status == delivery.OPEN %}<strong>Date limite de commande</strong> <time datetime="{{ delivery.order_before.date() }}">{{ delivery.order_before|date }}</time>{% elif delivery.status == delivery.ADJUSTMENT %}<strong>Ajustement en cours</strong>{% elif delivery.status == delivery.CLOSED %}<strong>{% if delivery.is_foreseen %}Fermée{% else %}À solder{% endif %}</strong>{% else %}<strong>Archivée</strong>{% endif %}</li>
|
||||
{% if delivery.instructions %}<li><i class="icon-lightbulb"></i> <strong>À savoir</strong> {{ delivery.instructions }}</li>{% endif %}
|
||||
{% if delivery.infos_url %}<li><i class="icon-global"></i><strong>Plus d'infos</strong> <a href="{{ delivery.infos_url }}" title="{{ delivery.infos_url }}">{{ delivery.infos_url|truncate(20)}}</a></li>{% endif %}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in a new issue