diff --git a/copanier/models.py b/copanier/models.py index a4edb78..6b797a4 100644 --- a/copanier/models.py +++ b/copanier/models.py @@ -257,6 +257,7 @@ class Delivery(PersistedBase): __root__ = "delivery" __lock__ = threading.Lock() + EMPTY = -1 CLOSED = 0 OPEN = 1 ADJUSTMENT = 2 @@ -281,6 +282,8 @@ class Delivery(PersistedBase): @property def status(self): + if not self.products: + return self.EMPTY if self.is_archived: return self.ARCHIVED if self.is_open: diff --git a/copanier/static/app.css b/copanier/static/app.css index f6112d7..b35c9fc 100644 --- a/copanier/static/app.css +++ b/copanier/static/app.css @@ -431,12 +431,12 @@ hr { width: 50%; } .notification { - width: 100%; text-align: center; color: white; line-height: 3rem; height: 3rem; vertical-align: middle; + margin: 1rem; } .notification.success { background-color: var(--success-color); @@ -462,6 +462,7 @@ hr { cursor: pointer; color: var(--link-color); } + .toggle-container { display: none; position: fixed; @@ -471,11 +472,15 @@ hr { width: 400px; border: 1px solid #999; background: white; - padding: 5px; + padding: 1rem; z-index: 100; overflow-y: auto; white-space: normal; } +.toggle-container h3 { + margin-top: 0.2em; +} + .toggle-background { position: fixed; width: 100%; @@ -605,6 +610,7 @@ table.paiements tr:hover td { } .progressbar { counter-reset: step; + padding-top: 2em; } .progressbar li { list-style-type: none; @@ -650,4 +656,8 @@ table.paiements tr:hover td { } .progressbar li.active + li:after { background-color: #55b776; +} + +.placeholder { + padding: 3rem !important; } \ No newline at end of file diff --git a/copanier/templates/delivery.html b/copanier/templates/delivery.html index fd369df..03c167f 100644 --- a/copanier/templates/delivery.html +++ b/copanier/templates/delivery.html @@ -6,13 +6,13 @@ {% block body %} {% include "includes/delivery_head.html" %} -{% if request['user'].email == delivery.contact %} +{% if request['user'].email == delivery.contact and delivery.status > delivery.EMPTY %}
Vous êtes la personne référente de cette distribution Voir la boîte à outils
{% elif request['user'].email in delivery.get_referents() %}
Vous êtes référent⋅e pour cette distribution (merci !). Gérer les produits dont vous vous occupez
{% endif %}