diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d9d335f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,2 @@
+serve:
+ ./venv/bin/copanier serve --reload
\ No newline at end of file
diff --git a/TODO b/TODO
index dae65c9..d07455a 100644
--- a/TODO
+++ b/TODO
@@ -18,10 +18,9 @@ x Permettre la supression des produits (terminer)
x Gérer le souci d'URL pour l'édition d'Apiluly
x Rendre plus visible l'action de modifier une commande
x Ajouter la trame (agenda d’une distribution) dans la boite à outil du coordinateur
+x Repasser sur les tests
+x Changer les liens d'emergement, de paiements et ???, trouver de meilleurs dénominations
-Changer les liens d'emergement, de solde et ???, trouver de meilleurs dénominations
Faire un refactoring des modèles
-Repasser sur les tests
-Explorer la possibilité de faire des ajustements automatiques
-Éditer directement depuis la vue « distribution »
\ No newline at end of file
+Create an "url_for" utility to simplify URL management.
\ No newline at end of file
diff --git a/copanier/static/signing-sheet.css b/copanier/static/order-summary.css
similarity index 100%
rename from copanier/static/signing-sheet.css
rename to copanier/static/order-summary.css
diff --git a/copanier/templates/delivery/compute_balance.html b/copanier/templates/delivery/compute_balance.html
index 69d8e1b..398e2d4 100644
--- a/copanier/templates/delivery/compute_balance.html
+++ b/copanier/templates/delivery/compute_balance.html
@@ -5,7 +5,7 @@
diff --git a/copanier/templates/delivery/show_delivery.html b/copanier/templates/delivery/show_delivery.html
index 2719a7f..3cb23d8 100644
--- a/copanier/templates/delivery/show_delivery.html
+++ b/copanier/templates/delivery/show_delivery.html
@@ -22,8 +22,8 @@
{% if request['user'].email == delivery.contact and delivery.status > delivery.EMPTY %}
diff --git a/copanier/templates/delivery/show_signing_sheet.html b/copanier/templates/delivery/show_orders_summary.html
similarity index 100%
rename from copanier/templates/delivery/show_signing_sheet.html
rename to copanier/templates/delivery/show_orders_summary.html
diff --git a/copanier/templates/delivery/show_toolbox.html b/copanier/templates/delivery/show_toolbox.html
index 29a12de..871367c 100644
--- a/copanier/templates/delivery/show_toolbox.html
+++ b/copanier/templates/delivery/show_toolbox.html
@@ -52,13 +52,13 @@
Préparation de la distribution |
La veille du {{ delivery.dates.delivery_date | date }} |
- Imprimer les bons de commandes par colocation |
+ Imprimer les bons de commandes par colocation |
— |
Distribution |
{{ delivery.dates.delivery_date | date }} |
- Coordoner la distribution, faire la répartition des chèques |
+ Coordoner la distribution, faire la répartition des chèques |
Arriver 30mn avant le début de la distribution, répartir les produits par coloc |
@@ -87,8 +87,8 @@ Une fois les commandes passées :
Pour préparer la distribution :
{% endblock %}
\ No newline at end of file
diff --git a/copanier/templates/includes/order_button.html b/copanier/templates/includes/order_button.html
index 79f3ebb..d7fc9c7 100644
--- a/copanier/templates/includes/order_button.html
+++ b/copanier/templates/includes/order_button.html
@@ -8,5 +8,5 @@
{% endif %}
{% if request.user.email in delivery.orders %}
- {{ delivery.total_for(request.user) }} €
+ {{ delivery.total_for(request.user) }} €
{% endif %}
diff --git a/copanier/views/core.py b/copanier/views/core.py
index 1e4dc10..1d74400 100644
--- a/copanier/views/core.py
+++ b/copanier/views/core.py
@@ -78,6 +78,11 @@ class Roll(BaseRoll):
def register_context(self, func):
self._context_func.append(func)
+ def url_for(self, view_name):
+ from pdb import set_trace
+
+ set_trace()
+
def staff_only(view):
async def decorator(request, response, *args, **kwargs):
diff --git a/copanier/views/delivery.py b/copanier/views/delivery.py
index a3d457a..2fc8bee 100644
--- a/copanier/views/delivery.py
+++ b/copanier/views/delivery.py
@@ -272,14 +272,14 @@ async def place_order(request, response, id):
)
-@app.route("/distribution/{id}/émargement", methods=["GET"])
-async def signing_sheet(request, response, id):
+@app.route("/distribution/{id}/résumé-de-commandes", methods=["GET"])
+async def orders_summary(request, response, id):
delivery = Delivery.load(id)
response.pdf(
- "delivery/show_signing_sheet.html",
+ "delivery/show_orders_summary.html",
{"delivery": delivery},
- css="signing-sheet.css",
- filename=utils.prefix("commandes-par-groupe.pdf", delivery),
+ css="orders-summary.css",
+ filename=utils.prefix("résumé-de-commandes.pdf", delivery),
)
@@ -321,8 +321,8 @@ async def adjust_product(request, response, id, ref):
)
-@app.route("/distribution/{id}/solde", methods=["GET"])
-@app.route("/distribution/{id}/solde.pdf", methods=["GET"])
+@app.route("/distribution/{id}/paiements", methods=["GET"])
+@app.route("/distribution/{id}/paiements.pdf", methods=["GET"])
@staff_only
async def delivery_balance(request, response, id):
delivery = Delivery.load(id)
diff --git a/setup.cfg b/setup.cfg
index c311b78..ef173da 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -9,7 +9,7 @@ install_requires =
Jinja2==2.10
openpyxl==2.6.1
PyJWT==1.7.1
- PyYAML==5.1
+ PyYAML==5.2
roll==0.10.1
ujson==1.35
minicli==0.4.4
diff --git a/tests/conftest.py b/tests/conftest.py
index 6435df6..a2e8243 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -89,6 +89,11 @@ def groups():
return groups
+@pytest.fixture
+def anothergroup():
+ return Group(id="another-group", name="Another Group", members=["another@bar.org"])
+
+
@pytest.fixture
def yaourt():
return Product(
diff --git a/tests/test_views.py b/tests/test_views_delivery.py
similarity index 99%
rename from tests/test_views.py
rename to tests/test_views_delivery.py
index 2cf5d8f..65d3e73 100644
--- a/tests/test_views.py
+++ b/tests/test_views_delivery.py
@@ -220,4 +220,4 @@ async def test_export_products(client, delivery):
'rupture'
),
("Lait", "lait", 1.5, delivery.products[0].last_update, None, None, None, "ferme-du-coin", None),
- ]
+ ]
\ No newline at end of file