mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 19:42:37 +02:00
Add an empty status.
This commit is contained in:
parent
f2ca52a060
commit
5eeea0dade
3 changed files with 29 additions and 8 deletions
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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 %}
|
||||
<div class="notification info"><i class="icon-lightbulb"></i> Vous êtes la personne référente de cette distribution <a class="button" href="/livraison/{{ delivery.id }}/gérer">Voir la boîte à outils</a></div>
|
||||
{% elif request['user'].email in delivery.get_referents() %}
|
||||
<div class="notification info"><i class="icon-lightbulb"></i> Vous êtes référent⋅e pour cette distribution (merci !). <a class="button" href="/livraison/{{ delivery.id }}/producteurices?referent={{request['user'].email}}">Gérer les produits dont vous vous occupez</a></div>
|
||||
{% endif %}
|
||||
<ul class="progressbar">
|
||||
<li {% if delivery.status == delivery.OPEN %}class="active"{% endif %}>Mise à jour des prix</li>
|
||||
<li {% if delivery.status == delivery.EMPTY %}class="active"{% endif %}>Mise à jour des prix</li>
|
||||
<li {% if delivery.status == delivery.OPEN %}class="active"{% endif %}>Ouverture des commandes</li>
|
||||
<li {% if delivery.status == delivery.ADJUSTMENT %}class="active"{% endif %}>Ajustements</li>
|
||||
<li {% if delivery.can_generate_reports %}class="active"{% endif %}>Achats par les référent⋅e⋅s</li>
|
||||
|
@ -22,10 +22,18 @@
|
|||
{% if delivery.has_products %}
|
||||
{% include "includes/delivery_table.html" %}
|
||||
{% else %}
|
||||
<p>Aucun produit n'est encore défini pour cette livraison.</p>
|
||||
{% if request.user and request.user.is_staff %}
|
||||
<div class="inline-text">Pour rajouter des produits, il faut d'abord <a href="/livraison/{{ delivery.id }}/exporter"><i class="icon-layers"></i> télécharger le tableur avec les produits</a>, le modifier localement sur votre machine puis </div> <div class="inline-text">{% with unique_id="import-products" %}{% include "includes/modal_import_products.html" %}{% endwith %}.</div>
|
||||
{% endif %}
|
||||
<div class="placeholder">
|
||||
<h2>Aucun produit n'est encore défini pour cette livraison.</h2>
|
||||
{% if request.user and request.user.is_staff %}
|
||||
<div class="inline-text">
|
||||
Pour rajouter des produits, deux options:
|
||||
<ol>
|
||||
<li><a href="/livraison/{{ delivery.id }}/exporter"><i class="icon-layers"></i>Télécharger le tableur avec les produits</a>, le modifier localement sur votre machine puis <div class="inline-text">{% with unique_id="import-products" %}{% include "includes/modal_import_products.html" %}{% endwith %}</div></li>
|
||||
<li>Ou bien ajouter les product⋅eurs⋅rices un⋅e par un⋅e dans l'interface</li>
|
||||
</ol>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</article>
|
||||
<hr>
|
||||
|
|
Loading…
Reference in a new issue