mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 19:42:37 +02:00
parent
dd1d9b7b9b
commit
e27d533f47
3 changed files with 10 additions and 7 deletions
|
@ -345,7 +345,6 @@ async def import_products(request, response, id):
|
||||||
async def list_producers(request, response, delivery_id):
|
async def list_producers(request, response, delivery_id):
|
||||||
delivery = Delivery.load(delivery_id)
|
delivery = Delivery.load(delivery_id)
|
||||||
response.html("list_products.html", {
|
response.html("list_products.html", {
|
||||||
'list_only': True,
|
|
||||||
'edit_mode': True,
|
'edit_mode': True,
|
||||||
'delivery': delivery,
|
'delivery': delivery,
|
||||||
'referent': request.query.get('referent', None),
|
'referent': request.query.get('referent', None),
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
<h3>{{ delivery.name }} {% include "includes/order_button.html" %}</h3>
|
<h3>{{ delivery.name }} {% include "includes/order_button.html" %}</h3>
|
||||||
{% include "includes/delivery_head.html" %}
|
{% include "includes/delivery_head.html" %}
|
||||||
{% if request['user'].email == delivery.contact %}
|
{% if request['user'].email == delivery.contact %}
|
||||||
<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">Gérer la distribution</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 !). Voici <a class="button" href="/livraison/{{ delivery.id }}/producteurices?referent={{request['user'].email}}">un petit lien pour aller voir 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 %}
|
||||||
<article class="delivery">
|
<article class="delivery">
|
||||||
{% if delivery.has_products %}
|
{% if delivery.has_products %}
|
||||||
|
|
|
@ -4,9 +4,13 @@
|
||||||
{% set producers = delivery.producers %}
|
{% set producers = delivery.producers %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for producer in producers %}
|
{% for producer in producers %}
|
||||||
<h2>{{ producer }} {% if edit_mode %}<a class="button" href="/livraison/{{ delivery.id }}/{{ producer }}/éditer"><i class="icon-ribbon"></i>Éditer</a> <a class="button" href="/livraison/{{ delivery.id }}/{{ producer }}/ajouter-produit"><i class="icon-puzzle"></i>Ajouter un produit </a>{% endif %}
|
<h2>{{ producer }}
|
||||||
{% if delivery.can_generate_reports and (request.user.is_staff or delivery.producers[producer].referent == request.user.email) %}
|
{% if edit_mode or request.user.is_staff or delivery.producers[producer].referent == request.user.email %}
|
||||||
<a class="button" href="/livraison/{{ delivery.id }}/{{ producer }}/bon-de-commande"><i class="icon-grid"></i> Télécharger le bon de commande</a>
|
<a class="button" href="/livraison/{{ delivery.id }}/{{ producer }}/éditer"><i class="icon-ribbon"></i> Éditer</a>
|
||||||
|
<a class="button" href="/livraison/{{ delivery.id }}/{{ producer }}/ajouter-produit"><i class="icon-puzzle"></i> Ajouter un produit </a>
|
||||||
|
{% if delivery.can_generate_reports %}
|
||||||
|
<a class="button" href="/livraison/{{ delivery.id }}/{{ producer }}/bon-de-commande"><i class="icon-grid"></i> Télécharger le bon de commande</a>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</h2>
|
</h2>
|
||||||
<h5>{% if delivery.producers[producer].description %}{{ delivery.producers[producer].description }}{% endif %}. Référent⋅e : {{ delivery.producers[producer].referent }} / {{ delivery.producers[producer].tel_referent }}</h5>
|
<h5>{% if delivery.producers[producer].description %}{{ delivery.producers[producer].description }}{% endif %}. Référent⋅e : {{ delivery.producers[producer].referent }} / {{ delivery.producers[producer].tel_referent }}</h5>
|
||||||
|
@ -41,6 +45,7 @@
|
||||||
{% if delivery.has_packing %}
|
{% if delivery.has_packing %}
|
||||||
<td class="packing">{% if product.packing %}{{ product.packing }} x {% endif %} {{ product.unit }}</td>
|
<td class="packing">{% if product.packing %}{{ product.packing }} x {% endif %} {{ product.unit }}</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if edit_mode %}<td><a href="/livraison/{{ delivery.id }}/{{ product.producer }}/{{ product.ref }}/éditer">modifier</a></td>{% endif %}
|
||||||
{% if not list_only %}
|
{% if not list_only %}
|
||||||
<th{% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} class="missing" title="Les commandes individuelles ne correspondent pas aux conditionnements"{% endif %}>
|
<th{% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} class="missing" title="Les commandes individuelles ne correspondent pas aux conditionnements"{% endif %}>
|
||||||
{{ delivery.product_wanted(product) }}
|
{{ delivery.product_wanted(product) }}
|
||||||
|
@ -52,7 +57,6 @@
|
||||||
<td title="Commandé: {{ order[product.ref].wanted }} — Ajusté: {{ "%+d"|format(order[product.ref].adjustment) }}">{{ order[product.ref].quantity or "—" }}</td>
|
<td title="Commandé: {{ order[product.ref].wanted }} — Ajusté: {{ "%+d"|format(order[product.ref].adjustment) }}">{{ order[product.ref].quantity or "—" }}</td>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if edit_mode %}<td><a href="/livraison/{{ delivery.id }}/{{ product.producer }}/{{ product.ref }}/éditer">modifier</a></td>{% endif %}
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if not list_only %}
|
{% if not list_only %}
|
||||||
|
|
Loading…
Reference in a new issue