From 9c8487efec057da15e9257efa9d247fbb26aadc3 Mon Sep 17 00:00:00 2001 From: Nanoy Date: Mon, 6 May 2019 08:41:34 +0200 Subject: [PATCH] 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 %}