mirror of
https://github.com/almet/copanier.git
synced 2025-05-02 21:31:48 +02:00
99 lines
3.7 KiB
HTML
99 lines
3.7 KiB
HTML
{% extends "base.html" %}
|
|
{% block toplink %}<a href="/distribution/{{ delivery.id }}/produits">↶ Retourner aux produits</a>{% endblock %}
|
|
|
|
{% block body %}
|
|
<div class="header">
|
|
{% if producer and producer.id %}
|
|
<h1>Modifier les informations pour « {{ producer.name }} »</h1>
|
|
<div class="pure-menu pure-menu-horizontal">
|
|
<ul class="pure-menu-list">
|
|
<li class="pure-menu-item">
|
|
<a class="pure-menu-link" href="/distribution/{{ delivery.id}}/{{ producer.id }}/ajouter-produit">Ajouter un produit</a>
|
|
</li>
|
|
<li class="pure-menu-item">
|
|
<a class="pure-menu-link" href="/distribution/{{ delivery.id}}/{{ producer.id }}/supprimer">Supprimer</a>
|
|
</li>
|
|
{% if producer.needs_price_update(delivery) %}
|
|
<li class="pure-menu-item">
|
|
<a class="pure-menu-link" href="/distribution/{{ delivery.id}}/{{ producer.id }}/valider-prix">Marquer les prix comme OK</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
{% else %}
|
|
<h1>Ajouter un⋅e producteur⋅rice</h1>
|
|
{% endif %}
|
|
</div>
|
|
{% if producer.needs_price_update(delivery) %}
|
|
<p class="notification info">Les prix pour {{ producer.name }} ont besoin d'être validés.</p>
|
|
{% endif %}
|
|
<form method="post">
|
|
{% if producer.id %}
|
|
<input type="hidden" name="id" value="{{ producer.id }}">
|
|
{% else %}
|
|
<label>
|
|
<p>Nom</p>
|
|
<input type="text" name="name" value="{{ proneeds_price_updateducer.name or '' }}">
|
|
</label>
|
|
{% endif %}
|
|
<label>
|
|
<h5>Description</h5>
|
|
<input type="text" name="description" value="{{ producer.description or '' }}">
|
|
</label>
|
|
<label>
|
|
<p>Email de la personne référente</p>
|
|
<input type="email" name="referent" value="{{ producer.referent or '' }}" required>
|
|
</label>
|
|
<label>
|
|
<p>Nom de la personne référente</p>
|
|
<input type="text" name="referent_name" value="{{ producer.referent_name or '' }}" required>
|
|
</label>
|
|
<label>
|
|
<p>Téléphone de la personne référente</p>
|
|
<input type="tel" name="referent_tel" value="{{ producer.referent_tel or '' }}" required>
|
|
</label>
|
|
<label>
|
|
<h5>Contact product⋅eur⋅rice</h5>
|
|
<input type="text" name="contact" value="{{ producer.contact or '' }}">
|
|
</label>
|
|
<div>
|
|
<input type="submit" name="submit" value="Valider" class="primary">
|
|
</div>
|
|
</form>
|
|
|
|
{% if products %}
|
|
<h3>Produits
|
|
<a class="button" href="/distribution/{{ delivery.id}}/{{ producer.id }}/ajouter-produit">Ajouter un produit</a>
|
|
{% if producer.needs_price_update(delivery) %}
|
|
<a class="button" href="/distribution/{{ delivery.id}}/{{ producer.id }}/valider-prix">Marquer les prix comme OK</a>
|
|
{% endif %}
|
|
</h3>
|
|
<p>Vous pouvez éditer les produits en cliquant sur leur nom.</p>
|
|
<table class="pure-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Produit</th>
|
|
<th>Prix</th>
|
|
<th>Unité</th>
|
|
<th>Description</th>
|
|
<th>Packaging</th>
|
|
<th>Rupture ?</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
{% for product in products %}
|
|
<tr>
|
|
<td><a href="/distribution/{{ delivery.id }}/{{ producer.id }}/produit/{{ product.ref }}/éditer">{{ product.name }}</a></td>
|
|
<td>{{ product.price }}€</td>
|
|
<td>{{ product.unit }}</td>
|
|
<td>{{ product.description }}</td>
|
|
<td>{% if product.packing %}{{ product.packing }}{% endif %}</td>
|
|
<td>{% if product.rupture %}RUPTURE !!{% endif %}</td>
|
|
<td><a href="/distribution/{{ delivery.id }}/{{ producer.id }}/{{ product.ref }}/supprimer">supprimer</a></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
|
|
<hr>
|
|
{% endblock body %}
|