copanier/copanier/templates/delivery/place_order.html

64 lines
3.4 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 %}
{% set group_name = request.groups.groups.get(person.name, person).name %}
<div class="header">
<h1>{{ delivery.name }}</h1>
<h4>Commande pour {{ group_name }}
{% if order.phone_number %}
(<a href="tel:{{ order.phone_number }}">{{ order.phone_number }}</a>)
{% endif %}
</h4>
{% include "includes/delivery_head.html" %}
</div>
<form method="post">
{% for producer in delivery.producers.values() %}
<h2>{{ producer.name }}</h2>
<table class="order pure-table">
<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.id) %}
<tr>
<th class="product {% if product.rupture %}rupture{% endif %}">{{ product }} {% if product.rupture %}(RUPTURE !){% endif %}
{% if product.description or product.img %}
{% 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">
<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="{{ url_for('place_order', id=delivery.id) }}?email={{ person.email }}&adjust">Ajuster</a>
{% endif %}
</form>
</article>
{% endblock body %}