copanier/copanier/templates/place_order.html

53 lines
2.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block body %}
<article class="order">
<h3><a href="/livraison/{{ delivery.id }}">{{ delivery.producer }}</a> — Commande de «{{ person.email }}»</h3>
{% include "includes/delivery_head.html" %}
<form method="post">
<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 order.has_adjustments %}<th class="amount">Ajustement +/</th>{% endif %}
</tr>
</thead>
<tbody>
{% for product in delivery.products %}
<tr>
<th class="product">{{ product }}
{% if product.description or product.img %}
{% with unique_id=loop.index %}
{% include "includes/modal_product.html" %}
{% endwith %}
{% endif %}</p>
</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) %} ({{ delivery.product_missing(product) }}){% endif %}</td>
{% endif %}
<td class="with-input"><input {% if delivery.status != delivery.OPEN %}type="text" readonly{% else%}type="number"{% endif%} min=0 name="wanted:{{ product.ref }}" value="{{ order[product].wanted }}"></td>
{% if delivery.status == delivery.ADJUSTMENT or order.has_adjustments %}
<td class="with-input"><input type="number" name="adjustment:{{ product.ref }}" value="{{ order[product].adjustment }}" {% if not delivery.product_missing(product) %}readonly{% endif %}></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
<p>Total: {{ order.total(delivery.products) if order else 0 }} €</p>
{% if delivery.is_passed %}
<p>Commande soldée: <input type="checkbox" name="paid" {% if order.paid %}checked{% endif %}></p>
{% endif %}
<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 %}
<a class="button" href="/livraison/{{ delivery.id }}/courriel?email={{ person.email }}">Envoyer par courriel</a>
</form>
</article>
{% endblock body %}