From acf770a4ef75cde83ddd067437cc11eacbc26c66 Mon Sep 17 00:00:00 2001 From: Nanoy Date: Mon, 6 May 2019 08:39:31 +0200 Subject: [PATCH 1/2] Add number of products on product's list --- gestion/templates/gestion/categories_list.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gestion/templates/gestion/categories_list.html b/gestion/templates/gestion/categories_list.html index 10bd2bd..4ec04ed 100644 --- a/gestion/templates/gestion/categories_list.html +++ b/gestion/templates/gestion/categories_list.html @@ -19,6 +19,7 @@ Nom Ordre + Nombre de produits (dont actifs) Administrer @@ -27,6 +28,7 @@ {{ category }} {% if category.order == 0 %}0 (non affichéé){% else %}{{category.order}}{% endif %} + {{category.product_set.count}} ({{category.active_products.count}}) Profil {% if perms.gestion.change_category %} Modifier{% endif %} {% endfor %} From 9c8487efec057da15e9257efa9d247fbb26aadc3 Mon Sep 17 00:00:00 2001 From: Nanoy Date: Mon, 6 May 2019 08:41:34 +0200 Subject: [PATCH 2/2] Only show category when not empty --- gestion/templates/gestion/manage.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gestion/templates/gestion/manage.html b/gestion/templates/gestion/manage.html index 8f0c22b..1319347 100644 --- a/gestion/templates/gestion/manage.html +++ b/gestion/templates/gestion/manage.html @@ -142,15 +142,17 @@ {% endif %} {% for category in categories %} + {% if category.active_products.count > 0 %} {{category}} {% for product in category.active_products %} {% if forloop.counter0|divisibleby:4 %} - {% endif %} + {% endif %} - {% if forloop.counter|divisibleby:4 %} + {% if forloop.counter|divisibleby:4 %} {% endif %} + {% endif %} {% endfor %} {% if not category.active_products|divisibleby:4 %}