mirror of
https://github.com/almet/copanier.git
synced 2025-05-03 05:31:48 +02:00
67 lines
3.6 KiB
HTML
67 lines
3.6 KiB
HTML
{% extends "base.html" %}
|
||
|
||
{% block body %}
|
||
{% set group_name = request.groups.groups[person.name].name %}
|
||
<article class="order">
|
||
<h3>
|
||
<a href="/livraison/{{ delivery.id }}">{{ delivery.name }}</a>
|
||
— Commande pour {{ group_name }}
|
||
{% if order.phone_number %}
|
||
(<a href="tel:{{ order.phone_number }}">{{ order.phone_number }}</a>)
|
||
{% endif %}</p>
|
||
</h3>
|
||
{% include "includes/delivery_head.html" %}
|
||
|
||
<form method="post">
|
||
{% for producer in delivery.producers %}
|
||
<h2>{{ producer }}</h2>
|
||
<table class="order">
|
||
<thead>
|
||
<tr>
|
||
<th class="product">Produit</th>
|
||
<th class="price">Prix</th>
|
||
{% if delivery.has_packing %}
|
||
<th class="packing">Conditionnement</th>
|
||
{% endif %}
|
||
<th class="amount">Commande</th>
|
||
{% if delivery.status == delivery.ADJUSTMENT or force_adjustment %}
|
||
<th class="amount">Ajustement +/−</th>
|
||
{% endif %}
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for product in delivery.get_products_by(producer) %}
|
||
<tr>
|
||
<th class="product {% if product.rupture %}rupture{% endif %}">{{ product }} {% if product.rupture %}(RUPTURE !){% endif %}
|
||
{% if product.description or product.img %}
|
||
{% with unique_id=loop.index %}
|
||
{% include "includes/modal_product.html" %}
|
||
{% endwith %}
|
||
{% endif %}
|
||
</th>
|
||
<td>{{ product.price | round(2) }} €</td>
|
||
{% if delivery.has_packing %}
|
||
<td {% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} class="missing" title="Les commandes individuelles ne correspondent pas aux conditionnements"{% endif %}>{{ product.packing or "—" }}{% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} (manque {{ delivery.product_missing(product) }}){% endif %}</td>
|
||
{% endif %}
|
||
<td class="with-input"><input {% if not request.user.is_referent(delivery) and delivery.status != delivery.OPEN or product.rupture %}type="text" readonly{% else%}type="number"{% endif%} min=0 name="wanted:{{ product.ref }}" value="{{ order[product].wanted }}">{% if not (delivery.status == delivery.ADJUSTMENT or force_adjustments) %} x {{ product.unit }}{% endif %}</td>
|
||
{% if delivery.status == delivery.ADJUSTMENT or force_adjustments %}
|
||
<td class="with-input"><input type="number" name="adjustment:{{ product.ref }}" value="{{ order[product].adjustment }}" min="{{ order[product].wanted * -1 }}" {% if not (delivery.product_missing(product) or force_adjustment) %}readonly{% endif %}> x {{ product.unit }}</td>
|
||
{% endif %}
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{% endfor %}
|
||
<p>On y est presque ! Est-ce que tu peux entrer un numéro de téléphone au cas où on ait besoin de vous joindre ?</p>
|
||
<input type="text" name="phone_number" value="{{ order.phone_number }}" placeholder="06 12 34 56 78">
|
||
<p>Total: {{ order.total(delivery.products) if order else 0 }} €</p>
|
||
<input type="hidden" name="email" value="{{ person.email }}">
|
||
{% if delivery.status != delivery.CLOSED or request.user.is_staff %}
|
||
<input type="submit" value="Enregistrer la commande" class="primary">
|
||
{% endif %}
|
||
{% if request.user.is_staff and delivery.status == delivery.CLOSED %}
|
||
<a class="button danger" href="/livraison/{{ delivery.id }}/commander?email={{ person.email }}&adjust">Ajuster</a>
|
||
{% endif %}
|
||
</form>
|
||
</article>
|
||
{% endblock body %}
|