mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 11:32:38 +02:00
Use the url_for helper rather than direct URLs in templates
This commit is contained in:
parent
6e19f3d339
commit
f108121035
19 changed files with 44 additions and 85 deletions
|
@ -22,7 +22,7 @@
|
|||
<a href="#" class="pure-menu-link"><i class="icon-printer"></i> Imprimer…</a>
|
||||
<ul class="pure-menu-children">
|
||||
<li class="pure-menu-item"><a href="{{ url_for('list_products', id=delivery.id) }}/produits.pdf" class="pure-menu-link"><i class="icon-ribbon"></i> Commande producteurs⋅rices</a></li>
|
||||
<li class="pure-menu-item"><a href="{{ url_for('orders_summary', id=delivery.id) }}" class="pure-menu-link"><i class="icon-grid"></i> Résumé de commande par groupe</a></li>
|
||||
<li class="pure-menu-item"><a href="{{ url_for('show_orders_summary', id=delivery.id) }}" class="pure-menu-link"><i class="icon-grid"></i> Résumé de commande par groupe</a></li>
|
||||
<li class="pure-menu-item"><a href="{{ url_for('compute_payments', id=delivery.id) }}" class="pure-menu-link"><i class="icon-wallet"></i> Répartition des paiements</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -64,7 +64,7 @@
|
|||
{% if request.user and request.user.is_staff %}
|
||||
Occupons-nous donc de ça ! Deux options :
|
||||
<ol>
|
||||
<li><a href="{{ url_for('create_producer', id=delivery.id) }}">Ajouter les product⋅eurs⋅rices</a> à la main ;</li>
|
||||
<li><a href="{{ url_for('create_producer', delivery_id=delivery.id) }}">Ajouter les product⋅eurs⋅rices</a> à la main ;</li>
|
||||
<li>Ou bien <a href="{{ url_for('copy_products', id=delivery.id) }}">copier les produits d'une autre distribution</a>.</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
|
|
@ -72,23 +72,23 @@
|
|||
|
||||
Avant et pendant la distribution :
|
||||
<ul>
|
||||
<li><a href="/groupes"><i class="icon-globe"></i> Gérer les groupes / colocs</a></li>
|
||||
<li><a href="/distribution/{{ delivery.id }}/edit"><i class="icon-pencil"></i> Modifier la commande (dates, lieu, référent⋅e, etc)</a></li>
|
||||
<li><a href="/produits/{{ delivery.id }}"><i class="icon-pencil"></i> Gérer les produits</a></li>
|
||||
<li><a href="{{ url_for('groups', id=delivery.id) }}"><i class="icon-globe"></i> Gérer les groupes / colocs</a></li>
|
||||
<li><a href="{{ url_for('edit_delivery', id=delivery.id) }}"><i class="icon-pencil"></i> Modifier la commande (dates, lieu, référent⋅e, etc)</a></li>
|
||||
<li><a href="{{ url_for('list_products', id=delivery.id) }}"><i class="icon-pencil"></i> Gérer les produits</a></li>
|
||||
</ul>
|
||||
|
||||
Une fois les commandes passées :
|
||||
<ul>
|
||||
<li><a href="/produits/{{ delivery.id }}/produits.pdf"><i class="icon-download"></i> Télécharger la liste des produits commandés</a></li>
|
||||
<li><a href="/distribution/{{ delivery.id }}/rapport-complet.xlsx"><i class="icon-download"></i> Télécharger le tableau des commandes</a></li>
|
||||
<li><a href="/distribution/{{ delivery.id }}/envoi-email-referentes"><i class="icon-envelope"></i> Envoyer les infos de commande aux référent⋅e⋅s</a></li>
|
||||
<li><a href="{{ url_for('list_products', id=delivery.id) }}/produits.pdf"><i class="icon-download"></i> Télécharger la liste des produits commandés</a></li>
|
||||
<li><a href="{{ url_for('generate_report', id=delivery.id) }}"><i class="icon-download"></i> Télécharger le tableau des commandes</a></li>
|
||||
<li><a href="{{ url_for('send_referent_emails', id=delivery.id) }}"><i class="icon-envelope"></i> Envoyer les infos de commande aux référent⋅e⋅s</a></li>
|
||||
</ul>
|
||||
|
||||
Pour préparer la distribution :
|
||||
|
||||
<ul>
|
||||
<li><a href="/distribution/{{ delivery.id }}/résumé-de-commandes"><i class="icon-document"></i> Fiches de commandes par groupe</a></li>
|
||||
<li><a href="/distribution/{{ delivery.id }}/paiements"><i class="icon-gears"></i> Faire la répartition des paiements</a></li>
|
||||
<li><a href="{{ url_for('show_orders_summary', id=delivery.id) }}"><i class="icon-document"></i> Fiches de commandes par groupe</a></li>
|
||||
<li><a href="{{ url_for('compute_payments', id=delivery.id) }}"><i class="icon-gears"></i> Faire la répartition des paiements</a></li>
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
<p>Voici le sésame, clique dessus pour t'authentifier, ou copie-colle-le dans ton navigateur:</p>
|
||||
|
||||
<a href="https://{{ hostname }}/connexion/{{ token }}">https://{{ hostname }}/connexion/{{ token }}</a>
|
||||
<a href="https://{{ hostname }}{{ url_for('set_sesame', token=token) }}">https://{{ hostname }}{{ url_for('set_sesame', token=token) }}</a>
|
||||
|
||||
<p>{{ config.EMAIL_SIGNATURE }}</p>
|
||||
|
|
|
@ -2,6 +2,6 @@ Hey ho!
|
|||
|
||||
Voici le sésame, clique dessus pour accéder à la commande :
|
||||
|
||||
https://{{ hostname }}/connexion/{{ token }}
|
||||
https://{{ hostname }}{{ url_for('set_sesame', token=token) }}
|
||||
|
||||
{{ config.EMAIL_SIGNATURE }}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
{% if group.id %}
|
||||
<ul class="toolbox">
|
||||
<li>
|
||||
<a href="/groupes/{{ group.id }}/supprimer" class="button danger"><i class="icon-hazardous"></i> Supprimer ce groupe</a>
|
||||
<a href="{{ url_for('delete_group', id=group.id) }}" class="button danger"><i class="icon-hazardous"></i> Supprimer ce groupe</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div class="pure-menu pure-menu-horizontal">
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="/groupes/créer"><i class="icon-globe"></i> Créer un nouveau groupe</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('create_group') }}"><i class="icon-globe"></i> Créer un nouveau groupe</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -36,12 +36,12 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
</td>
|
||||
<td>{% if group.id != request['user'].group_id %}<a class="pure-button" href="/groupes/{{ group.id}}/rejoindre">rejoindre</a>{% endif %} <a class="pure-button" href="/groupes/{{ group.id }}/éditer">éditer</a></td>
|
||||
<td>{% if group.id != request['user'].group_id %}<a class="pure-button" href="{{ url_for('join_group', id=group.id) }}">rejoindre</a>{% endif %} <a class="pure-button" href="{{ url_for('edit_group', id=group.id) }}">éditer</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p>Tu ne fais partie d'aucun des groupes listés ici ? Tu peux <a class="button" href="/groupes/créer"><i class="icon-globe"></i> en créer un nouveau</a></p>
|
||||
<p>Tu ne fais partie d'aucun des groupes listés ici ? Tu peux <a class="button" href="{{ url_for('create_group') }}"><i class="icon-globe"></i> en créer un nouveau</a></p>
|
||||
|
||||
{% endblock %}
|
|
@ -2,7 +2,7 @@
|
|||
<ul class="delivery">
|
||||
{% for delivery in deliveries %}
|
||||
<li>
|
||||
<a href="/distribution/{{ delivery.id }}"><i class="icon-hotairballoon"></i> {{ delivery.name }}</a> du {{ delivery.from_date|date|capitalize }}
|
||||
<a href="{{ url_for('show_delivery', id=delivery.id) }}"><i class="icon-hotairballoon"></i> {{ delivery.name }}</a> du {{ delivery.from_date|date|capitalize }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
{% if producer_obj.needs_price_update(delivery) %}*{% endif %}
|
||||
{% if edit_mode or request.user.is_staff or producer_obj.referent == request.user.email %}
|
||||
<span class="edit">
|
||||
<a class="button" href="/produits/{{ delivery.id }}/producteurs/{{ producer_obj.id }}"><i class="icon-ribbon"></i> Gérer ce⋅tte producteur⋅rice</a>
|
||||
<a class="button" href="{{ url_for('edit_producer', delivery_id=delivery.id, producer_id=producer_obj.id) }}"><i class="icon-ribbon"></i> Gérer ce⋅tte producteur⋅rice</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
</h2>
|
||||
<h5>{% if producer_obj.description %}{{ producer_obj.description }}{% endif %}. Référent⋅e : <a href="mailto:{{ producer_obj.referent }}">{{ producer_obj.referent_name }}</a> / {{ producer_obj.referent_tel }}</h5>
|
||||
{% if not delivery.get_products_by(producer) %}
|
||||
😔 Ce⋅tte producteur⋅rice n'a pas encore de produits. Voulez vous <a href="/produits/{{ delivery.id }}/producteurs/{{ producer }}/produits/créer">en rajouter un ?</a>
|
||||
😔 Ce⋅tte producteur⋅rice n'a pas encore de produits. Voulez vous <a href="{{ url_for('create_product', delivery_id=delivery.id, producer_id=producer_obj.id) }}">en rajouter un ?</a>
|
||||
{% else %}
|
||||
<table class="delivery pure-table">
|
||||
<thead>
|
||||
|
@ -31,7 +31,7 @@
|
|||
{% set orderer_name = request.groups.groups[orderer].name %}
|
||||
<th class="person">
|
||||
{% if request.user and (request.user.is_staff or request.user.is_referent(delivery)) %}
|
||||
<a class="underline" href="/distribution/{{ delivery.id }}/commander?orderer={{ orderer }}" title="{{ orderer }}">{{ orderer_name }} <i class="icon-pencil"></i></a>
|
||||
<a class="underline" href="{{ url_for('place_order', id=delivery.id) }}?orderer={{ orderer }}" title="{{ orderer }}">{{ orderer_name }} <i class="icon-pencil"></i></a>
|
||||
{% else %}
|
||||
<span title="{{ orderer }}">{{ orderer_name }}</span>
|
||||
{% endif %}
|
||||
|
@ -43,7 +43,7 @@
|
|||
<tbody>
|
||||
{% for product in delivery.get_products_by(producer) %}
|
||||
<tr>
|
||||
<th class="product {% if product.rupture %}rupture{% endif %}">{% if edit_mode %}<a href="/produits/{{ delivery.id }}/producteurs/{{ product.producer }}/produits/{{ product.ref }}">{% endif %}{% if edit_mode %}<i class="icon-pencil"></i> {% endif %}{% if product.rupture %} (rupture){% endif %} {{ product }}{% if edit_mode %}</a>{% endif %}
|
||||
<th class="product {% if product.rupture %}rupture{% endif %}">{% if edit_mode %}<a href="{{ url_for('edit_product', delivery_id=delivery.id, producer_id=producer_obj.id, product_ref=product.ref) }}">{% endif %}{% if edit_mode %}<i class="icon-pencil"></i> {% endif %}{% if product.rupture %} (rupture){% endif %} {{ product }}{% if edit_mode %}</a>{% endif %}
|
||||
<td>{{ product.price | round(2) }} €</td>
|
||||
{% if delivery.has_packing %}
|
||||
<td class="packing">{% if product.packing %}{{ product.packing }} x {% endif %} {{ product.unit }}</td>
|
||||
|
@ -51,7 +51,7 @@
|
|||
<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) }}
|
||||
{% if delivery.status == delivery.ADJUSTMENT and delivery.product_missing(product) %} (−{{ delivery.product_missing(product) }})
|
||||
{% if request.user.is_staff %}<a href="/distribution/{{ delivery.id }}/ajuster/{{ product.ref }}" class="button" title="ajuster le produit">ajuster</a>{% endif %}
|
||||
{% if request.user.is_staff %}<a href="{{ url_for('adjust_product', id=delivery.id, ref=product.ref) }}" class="button" title="ajuster le produit">ajuster</a>{% endif %}
|
||||
{% endif %}
|
||||
</th>
|
||||
{% if not list_only %}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% if (delivery.status == delivery.OPEN or delivery.status == delivery.ADJUSTMENT) and delivery.has_products %}
|
||||
<a class="button" href="/distribution/{{ delivery.id }}/commander">
|
||||
<a class="button" href="{{ url_for('place_order', id=delivery.id) }}">
|
||||
{% if delivery.status == delivery.ADJUSTMENT %}
|
||||
Ajuster ma commande
|
||||
{% elif delivery.status == delivery.OPEN %}
|
||||
|
@ -8,5 +8,5 @@
|
|||
</a>
|
||||
{% endif %}
|
||||
{% if request.user.email in delivery.orders %}
|
||||
<span class="flag" title="Mon paiements"><i class="icon-wallet"></i> {{ delivery.total_for(request.user) }} €</span>
|
||||
<span class="flag" title="Mes paiements"><i class="icon-wallet"></i> {{ delivery.total_for(request.user) }} €</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
{% if link == "deliveries" %}
|
||||
↶ Retourner à la liste des distributions
|
||||
{% elif link == "products" %}
|
||||
↶ Retourner à la liste des produits
|
||||
{% elif link == "producer" %}
|
||||
↶ Retourner à la fiche product⋅eur⋅rice
|
||||
{% endif %}
|
|
@ -1,5 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
{% block toplink %}<a href="/produits/{{ delivery.id }}/producteurs/{{producer.id}}">↶ Retourner a « {{producer.name}} »</a>{% endblock %}
|
||||
{% block toplink %}<a href="{{ url_for('edit_producer', delivery_id=delivery.id, producer_id=producer.id) }}">↶ Retourner a « {{producer.name}} »</a>{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="header">
|
||||
|
|
|
@ -34,34 +34,5 @@
|
|||
</div>
|
||||
</form>
|
||||
|
||||
{% if products %}
|
||||
<h3>Produits</h3>
|
||||
|
||||
<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="/produits/{{ delivery.id }}/producteurs/{{ producer.id }}/produits/{{ product.ref }}">{{ 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="/produits/{{ delivery.id }}/producteurs/{{ producer.id }}/produits/{{ product.ref }}">éditer</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
<hr>
|
||||
{% endblock body %}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
{% block toplink %}<a href="/produits/{{ delivery.id }}">↶ Retourner aux produits</a>{% endblock %}
|
||||
{% block toplink %}<a href="{{ url_for('list_products', id=delivery.id) }}">↶ Retourner aux produits</a>{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="header">
|
||||
|
@ -8,17 +8,17 @@
|
|||
<div class="pure-menu pure-menu-horizontal">
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="/produits/{{ delivery.id}}/producteurs/{{ producer.id }}/produits/créer">Ajouter un produit</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('create_product', delivery_id=delivery.id, producer_id=producer.id) }}">Ajouter un produit</a>
|
||||
</li>
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="/produits/{{ delivery.id}}/producteurs/{{ producer.id }}/supprimer">Supprimer</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('delete_producer', delivery_id=delivery.id, producer_id=producer.id) }}">Supprimer</a>
|
||||
</li>
|
||||
<li class="pure-menu-list">
|
||||
<a class="pure-menu-link" href="/produits/{{ delivery.id}}/producteurs/{{ producer.id }}/frais-de-livraison">Gérer des frais de livraison</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('edit_shipping_price', delivery_id=delivery.id, producer_id=producer.id) }}">Gérer des frais de livraison</a>
|
||||
</li>
|
||||
{% if producer.needs_price_update(delivery) %}
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="/produits/{{ delivery.id}}/producteurs/{{ producer.id }}/valider-prix">Marquer les prix comme OK</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('validate_producer_prices', delivery_id=delivery.id, producer_id=producer.id) }}">Marquer les prix comme OK</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
@ -67,14 +67,14 @@
|
|||
{% if delivery.shipping.get(producer.id) %}
|
||||
<h3>Frais de livraison</h3>
|
||||
Des frais de livraison de {{ delivery.shipping[producer.id] }}€ ont été enregistrés pour ce producteur.
|
||||
<a class="button" href="/produits/{{ delivery.id}}/producteurs/{{ producer.id }}/frais-de-livraison">Modifier</a>
|
||||
<a class="button" href="{{ url_for('edit_shipping_price', delivery_id=delivery.id, producer_id=producer.id) }}">Modifier</a>
|
||||
{% endif %}
|
||||
|
||||
{% if products %}
|
||||
<h3>Produits
|
||||
<a class="button" href="/produits/{{ delivery.id}}/producteurs/{{ producer.id }}/produits/créer">Ajouter un produit</a>
|
||||
<a class="button" href="{{ url_for('create_product', delivery_id=delivery.id, producer_id=producer.id) }}">Ajouter un produit</a>
|
||||
{% if producer.needs_price_update(delivery) %}
|
||||
<a class="button" href="/produits/{{ delivery.id}}/producteurs/{{ producer.id }}/valider-prix">Marquer les prix comme OK</a>
|
||||
<a class="button" href="{{ url_for('validate_producer_prices', delivery_id=delivery.id, producer_id=producer.id) }}">Marquer les prix comme OK</a>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<p>Vous pouvez éditer les produits en cliquant sur leur nom.</p>
|
||||
|
@ -92,13 +92,13 @@ Des frais de livraison de {{ delivery.shipping[producer.id] }}€ ont été enre
|
|||
</thead>
|
||||
{% for product in products %}
|
||||
<tr>
|
||||
<td><a href="/produits/{{ delivery.id }}/producteurs/{{ producer.id }}/produits/{{ product.ref }}">{{ product.name }}</a></td>
|
||||
<td><a href="{{ url_for('edit_product', delivery_id=delivery.id, producer_id=producer.id, product_ref=product.ref) }}">{{ 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="/produits/{{ delivery.id }}/producteurs/{{ producer.id }}/produits/{{ product.ref }}/supprimer">supprimer</a></td>
|
||||
<td><a href="{{ url_for('delete_product', delivery_id=delivery.id, producer_id=producer.id, product_ref=product.ref) }}">supprimer</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block toplink %}<a href="/produits/{{ delivery.id }}/producteurs/{{ producer.id }}">↶ Retourner aux produits de {{ producer.name }}</a>{% endblock %}
|
||||
{% block toplink %}<a href="{{ url_for('edit_producer', delivery_id=delivery.id, producer_id=producer.id) }}">↶ Retourner aux produits de {{ producer.name }}</a>{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
|||
<div class="pure-menu pure-menu-horizontal">
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="/produits/{{ delivery.id}}/producteurs/{{ producer.id }}/produits/{{ product.ref }}/supprimer">Supprimer ce produit</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('delete_product', delivery_id=delivery.id, producer_id=producer.id, product_ref=product.ref) }}">Supprimer ce produit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
{% block toplink %}<a href="/produits/{{ delivery.id }}">↶ Retourner aux produits</a>{% endblock %}
|
||||
{% block toplink %}<a href="{{ url_for('edit_producer', delivery_id=delivery.id, producer_id=producer.id) }}">↶ Retourner a {{ producer.name }}</a>{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="header">
|
||||
|
|
|
@ -6,20 +6,14 @@
|
|||
<div class="pure-menu pure-menu-horizontal">
|
||||
<ul class="pure-menu-list">
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="/produits/{{ delivery.id }}/producteurs/créer"><i class="icon-heart"></i> Ajouter un⋅e producteur⋅rice</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('create_producer', delivery_id=delivery.id) }}"><i class="icon-heart"></i> Ajouter un⋅e producteur⋅rice</a>
|
||||
</li>
|
||||
<li class="pure-menu-item">
|
||||
<a class="pure-menu-link" href="/produits/{{ delivery.id }}/copier"><i class="icon-hotairballoon"></i> Réutiliser les produits d'une autre distrib</a>
|
||||
<a class="pure-menu-link" href="{{ url_for('copy_products', id=delivery.id) }}"><i class="icon-hotairballoon"></i> Réutiliser les produits d'une autre distrib</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<p class="hide-on-print">
|
||||
{% if producers %}
|
||||
<a href="/produits/{{ delivery.id }}/produits.pdf{% if referent %}?referent={{ referent }}{% endif %}">Télécharger la liste des commandes en PDF</a>
|
||||
{% endif %}
|
||||
{% if referent %}Voici la liste des product⋅eurs⋅rices dont {{ referent }} est référent⋅e. <a class="button" href="/produits/{{delivery.id}}">voir tous les produits</a>{% endif %}
|
||||
</p>
|
||||
|
||||
<article class="delivery">
|
||||
{% include "includes/delivery_table.html" %}
|
||||
|
|
|
@ -284,7 +284,7 @@ async def show_orders_summary(request, response, id):
|
|||
|
||||
|
||||
@app.route("/distribution/{id}/rapport-complet.xlsx", methods=["GET"])
|
||||
async def xls_full_report(request, response, id):
|
||||
async def generate_report(request, response, id):
|
||||
delivery = Delivery.load(id)
|
||||
date = delivery.to_date.strftime("%Y-%m-%d")
|
||||
response.xlsx(
|
||||
|
|
|
@ -50,6 +50,7 @@ async def send_sesame(request, response):
|
|||
f"Sésame {config.SITE_NAME}",
|
||||
hostname=request.host,
|
||||
token=token.decode(),
|
||||
url_for=app.url_for,
|
||||
)
|
||||
except RuntimeError:
|
||||
response.message("Oops, impossible d'envoyer le courriel…", status="error")
|
||||
|
|
|
@ -147,7 +147,7 @@ async def edit_product(request, response, delivery_id, producer_id, product_ref)
|
|||
@app.route(
|
||||
"/produits/{delivery_id}/producteurs/{producer_id}/valider-prix", methods=["GET"]
|
||||
)
|
||||
async def mark_producer_prices_as_ok(request, response, delivery_id, producer_id):
|
||||
async def validate_producer_prices(request, response, delivery_id, producer_id):
|
||||
delivery = Delivery.load(delivery_id)
|
||||
producer = delivery.producers.get(producer_id)
|
||||
|
||||
|
@ -217,7 +217,7 @@ async def create_product(request, response, delivery_id, producer_id):
|
|||
"/produits/{delivery_id}/producteurs/{producer_id}/frais-de-livraison",
|
||||
methods=["GET", "POST"],
|
||||
)
|
||||
async def set_shipping_price(request, response, delivery_id, producer_id):
|
||||
async def edit_shipping_price(request, response, delivery_id, producer_id):
|
||||
delivery = Delivery.load(delivery_id)
|
||||
producer = delivery.producers.get(producer_id)
|
||||
|
||||
|
|
Loading…
Reference in a new issue