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
1f9a1ff10f
commit
93fbf5f736
3 changed files with 29 additions and 8 deletions
|
@ -257,6 +257,7 @@ class Delivery(PersistedBase):
|
||||||
|
|
||||||
__root__ = "delivery"
|
__root__ = "delivery"
|
||||||
__lock__ = threading.Lock()
|
__lock__ = threading.Lock()
|
||||||
|
EMPTY = -1
|
||||||
CLOSED = 0
|
CLOSED = 0
|
||||||
OPEN = 1
|
OPEN = 1
|
||||||
ADJUSTMENT = 2
|
ADJUSTMENT = 2
|
||||||
|
@ -281,6 +282,8 @@ class Delivery(PersistedBase):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def status(self):
|
def status(self):
|
||||||
|
if not self.products:
|
||||||
|
return self.EMPTY
|
||||||
if self.is_archived:
|
if self.is_archived:
|
||||||
return self.ARCHIVED
|
return self.ARCHIVED
|
||||||
if self.is_open:
|
if self.is_open:
|
||||||
|
|
|
@ -431,12 +431,12 @@ hr {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
.notification {
|
.notification {
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: white;
|
color: white;
|
||||||
line-height: 3rem;
|
line-height: 3rem;
|
||||||
height: 3rem;
|
height: 3rem;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
margin: 1rem;
|
||||||
}
|
}
|
||||||
.notification.success {
|
.notification.success {
|
||||||
background-color: var(--success-color);
|
background-color: var(--success-color);
|
||||||
|
@ -462,6 +462,7 @@ hr {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: var(--link-color);
|
color: var(--link-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle-container {
|
.toggle-container {
|
||||||
display: none;
|
display: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
@ -471,11 +472,15 @@ hr {
|
||||||
width: 400px;
|
width: 400px;
|
||||||
border: 1px solid #999;
|
border: 1px solid #999;
|
||||||
background: white;
|
background: white;
|
||||||
padding: 5px;
|
padding: 1rem;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
.toggle-container h3 {
|
||||||
|
margin-top: 0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
.toggle-background {
|
.toggle-background {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -605,6 +610,7 @@ table.paiements tr:hover td {
|
||||||
}
|
}
|
||||||
.progressbar {
|
.progressbar {
|
||||||
counter-reset: step;
|
counter-reset: step;
|
||||||
|
padding-top: 2em;
|
||||||
}
|
}
|
||||||
.progressbar li {
|
.progressbar li {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
@ -651,3 +657,7 @@ table.paiements tr:hover td {
|
||||||
.progressbar li.active + li:after {
|
.progressbar li.active + li:after {
|
||||||
background-color: #55b776;
|
background-color: #55b776;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.placeholder {
|
||||||
|
padding: 3rem !important;
|
||||||
|
}
|
|
@ -6,13 +6,13 @@
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% include "includes/delivery_head.html" %}
|
{% 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>
|
<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() %}
|
{% 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>
|
<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 %}
|
{% endif %}
|
||||||
<ul class="progressbar">
|
<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.OPEN %}class="active"{% endif %}>Ouverture des commandes</li>
|
||||||
<li {% if delivery.status == delivery.ADJUSTMENT %}class="active"{% endif %}>Ajustements</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>
|
<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 %}
|
{% if delivery.has_products %}
|
||||||
{% include "includes/delivery_table.html" %}
|
{% include "includes/delivery_table.html" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Aucun produit n'est encore défini pour cette livraison.</p>
|
<div class="placeholder">
|
||||||
|
<h2>Aucun produit n'est encore défini pour cette livraison.</h2>
|
||||||
{% if request.user and request.user.is_staff %}
|
{% 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>
|
<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 %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</article>
|
</article>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
Loading…
Reference in a new issue