From 80a61066a061e9fefd96a6e60f414b592a1f3f5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexis=20M=C3=83taireau?=
Date: Tue, 7 Apr 2020 16:41:07 +0200
Subject: [PATCH] Reorganize URLs and templates.
Reorganizing the URLs seems to fix an issue with namespace collision in the URLs.
- URLs for product related operations are now in the /produits/ namespace ;
- Templates are now using a formalism of action_subject.html, which makes it simpler to find find them.
---
.../ajust_product.html} | 0
.../{balance.html => compute_balance.html} | 0
.../{edit.html => edit_delivery.html} | 2 +-
.../{archives.html => list_archives.html} | 0
.../{list.html => list_deliveries.html} | 0
...email.html => prepare_referent_email.html} | 0
.../{show.html => show_delivery.html} | 10 +--
...ing_sheet.html => show_signing_sheet.html} | 0
.../{toolbox.html => show_toolbox.html} | 4 +-
.../groups/{edit.html => edit_group.html} | 0
.../groups/{list.html => list_groups.html} | 0
.../templates/includes/delivery_table.html | 6 +-
.../templates/{sesame.html => login.html} | 0
.../copy.html => products/copy_products.html} | 0
.../templates/products/delete_producer.html | 2 +-
.../{delete.html => delete_product.html} | 4 +-
.../templates/products/edit_producer.html | 20 ++---
.../products/{edit.html => edit_product.html} | 45 ++--------
...ping_fees.html => edit_shipping_fees.html} | 2 +-
.../{list.html => list_products.html} | 8 +-
copanier/views/delivery.py | 22 ++---
copanier/views/groups.py | 6 +-
copanier/views/login.py | 10 +--
copanier/views/products.py | 84 ++++++++-----------
24 files changed, 92 insertions(+), 133 deletions(-)
rename copanier/templates/{products/ajust.html => delivery/ajust_product.html} (100%)
rename copanier/templates/delivery/{balance.html => compute_balance.html} (100%)
rename copanier/templates/delivery/{edit.html => edit_delivery.html} (92%)
rename copanier/templates/delivery/{archives.html => list_archives.html} (100%)
rename copanier/templates/delivery/{list.html => list_deliveries.html} (100%)
rename copanier/templates/delivery/{referent_email.html => prepare_referent_email.html} (100%)
rename copanier/templates/delivery/{show.html => show_delivery.html} (80%)
rename copanier/templates/delivery/{signing_sheet.html => show_signing_sheet.html} (100%)
rename copanier/templates/delivery/{toolbox.html => show_toolbox.html} (83%)
rename copanier/templates/groups/{edit.html => edit_group.html} (100%)
rename copanier/templates/groups/{list.html => list_groups.html} (100%)
rename copanier/templates/{sesame.html => login.html} (100%)
rename copanier/templates/{delivery/copy.html => products/copy_products.html} (100%)
rename copanier/templates/products/{delete.html => delete_product.html} (89%)
rename copanier/templates/products/{edit.html => edit_product.html} (57%)
rename copanier/templates/products/{shipping_fees.html => edit_shipping_fees.html} (79%)
rename copanier/templates/products/{list.html => list_products.html} (56%)
diff --git a/copanier/templates/products/ajust.html b/copanier/templates/delivery/ajust_product.html
similarity index 100%
rename from copanier/templates/products/ajust.html
rename to copanier/templates/delivery/ajust_product.html
diff --git a/copanier/templates/delivery/balance.html b/copanier/templates/delivery/compute_balance.html
similarity index 100%
rename from copanier/templates/delivery/balance.html
rename to copanier/templates/delivery/compute_balance.html
diff --git a/copanier/templates/delivery/edit.html b/copanier/templates/delivery/edit_delivery.html
similarity index 92%
rename from copanier/templates/delivery/edit.html
rename to copanier/templates/delivery/edit_delivery.html
index eceaa05..7029f56 100644
--- a/copanier/templates/delivery/edit.html
+++ b/copanier/templates/delivery/edit_delivery.html
@@ -12,7 +12,7 @@
{% endif %}
diff --git a/copanier/templates/delivery/archives.html b/copanier/templates/delivery/list_archives.html
similarity index 100%
rename from copanier/templates/delivery/archives.html
rename to copanier/templates/delivery/list_archives.html
diff --git a/copanier/templates/delivery/list.html b/copanier/templates/delivery/list_deliveries.html
similarity index 100%
rename from copanier/templates/delivery/list.html
rename to copanier/templates/delivery/list_deliveries.html
diff --git a/copanier/templates/delivery/referent_email.html b/copanier/templates/delivery/prepare_referent_email.html
similarity index 100%
rename from copanier/templates/delivery/referent_email.html
rename to copanier/templates/delivery/prepare_referent_email.html
diff --git a/copanier/templates/delivery/show.html b/copanier/templates/delivery/show_delivery.html
similarity index 80%
rename from copanier/templates/delivery/show.html
rename to copanier/templates/delivery/show_delivery.html
index afd7138..2719a7f 100644
--- a/copanier/templates/delivery/show.html
+++ b/copanier/templates/delivery/show_delivery.html
@@ -21,7 +21,7 @@
{% endif %}
Merci de mettre à jour les prix pour « {{ producer.name }} ».
+ Merci de mettre à jour les prix pour « {{ producer.name }} ».
{% endif %}
{% endfor %}
{% include "includes/delivery_table.html" %}
@@ -64,8 +64,8 @@
{% if request.user and request.user.is_staff %}
Occupons-nous donc de ça ! Deux options :
- - Ajouter les product⋅eurs⋅rices à la main ;
- - Ou bien copier les produits d'une autre distribution.
+ - Ajouter les product⋅eurs⋅rices à la main ;
+ - Ou bien copier les produits d'une autre distribution.
{% endif %}
diff --git a/copanier/templates/delivery/signing_sheet.html b/copanier/templates/delivery/show_signing_sheet.html
similarity index 100%
rename from copanier/templates/delivery/signing_sheet.html
rename to copanier/templates/delivery/show_signing_sheet.html
diff --git a/copanier/templates/delivery/toolbox.html b/copanier/templates/delivery/show_toolbox.html
similarity index 83%
rename from copanier/templates/delivery/toolbox.html
rename to copanier/templates/delivery/show_toolbox.html
index 7c0eb5c..4ff7f8a 100644
--- a/copanier/templates/delivery/toolbox.html
+++ b/copanier/templates/delivery/show_toolbox.html
@@ -14,11 +14,11 @@
Avant et pendant la distribution
Modifier la commande (dates, lieu, référent⋅e, etc)
- Modifier les produits, les product⋅rices⋅eurs
+ Modifier les produits, les product⋅rices⋅eurs
Gérer les groupes / colocs
Une fois les commandes passées (après le {{ delivery.order_before|date }})
- Télécharger les bons de distribution
+ Télécharger les bons de distribution
Télécharger le tableau des commandes
Envoyer les infos de commande aux référent⋅e⋅s
diff --git a/copanier/templates/groups/edit.html b/copanier/templates/groups/edit_group.html
similarity index 100%
rename from copanier/templates/groups/edit.html
rename to copanier/templates/groups/edit_group.html
diff --git a/copanier/templates/groups/list.html b/copanier/templates/groups/list_groups.html
similarity index 100%
rename from copanier/templates/groups/list.html
rename to copanier/templates/groups/list_groups.html
diff --git a/copanier/templates/includes/delivery_table.html b/copanier/templates/includes/delivery_table.html
index 1a89e8a..dda8151 100644
--- a/copanier/templates/includes/delivery_table.html
+++ b/copanier/templates/includes/delivery_table.html
@@ -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 %}
- Gérer ce⋅tte producteur⋅rice
+ Gérer ce⋅tte producteur⋅rice
{% endif %}
{% if producer_obj.description %}{{ producer_obj.description }}{% endif %}. Référent⋅e : {{ producer_obj.referent_name }} / {{ producer_obj.referent_tel }}
{% if not delivery.get_products_by(producer) %}
-😔 Ce⋅tte producteur⋅rice n'a pas encore de produits. Voulez vous en rajouter un ?
+😔 Ce⋅tte producteur⋅rice n'a pas encore de produits. Voulez vous en rajouter un ?
{% else %}
@@ -43,7 +43,7 @@
{% for product in delivery.get_products_by(producer) %}
- {% if edit_mode %}{% endif %}{% if edit_mode %} {% endif %}{{ product }}{% if edit_mode %}{% endif %}{% if product.rupture %} {{ product.rupture }}{% endif %}
+ | {% if edit_mode %}{% endif %}{% if edit_mode %} {% endif %}{{ product }}{% if edit_mode %}{% endif %}{% if product.rupture %} {{ product.rupture }}{% endif %}
| {{ product.price | round(2) }} € |
{% if delivery.has_packing %}
{% if product.packing %}{{ product.packing }} x {% endif %} {{ product.unit }} |
diff --git a/copanier/templates/sesame.html b/copanier/templates/login.html
similarity index 100%
rename from copanier/templates/sesame.html
rename to copanier/templates/login.html
diff --git a/copanier/templates/delivery/copy.html b/copanier/templates/products/copy_products.html
similarity index 100%
rename from copanier/templates/delivery/copy.html
rename to copanier/templates/products/copy_products.html
diff --git a/copanier/templates/products/delete_producer.html b/copanier/templates/products/delete_producer.html
index 121473d..e98c2b1 100644
--- a/copanier/templates/products/delete_producer.html
+++ b/copanier/templates/products/delete_producer.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% block toplink %}↶ Retourner a « {{producer.name}} »{% endblock %}
+{% block toplink %}↶ Retourner a « {{producer.name}} »{% endblock %}
{% block body %}
diff --git a/copanier/templates/products/edit_producer.html b/copanier/templates/products/edit_producer.html
index 45b6e2f..aabef76 100644
--- a/copanier/templates/products/edit_producer.html
+++ b/copanier/templates/products/edit_producer.html
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% block toplink %}↶ Retourner aux produits{% endblock %}
+{% block toplink %}↶ Retourner aux produits{% endblock %}
{% block body %}