From b3ea2bfb9a24b3b86c9544b587ece6d78e70baae Mon Sep 17 00:00:00 2001
From: Oliver Walters <oliver.henry.walters@gmail.com>
Date: Thu, 19 Sep 2019 23:38:15 +1000
Subject: [PATCH] Update badges

---
 InvenTree/part/templates/part/subcategories.html   | 4 +++-
 InvenTree/stock/templates/stock/location_list.html | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/InvenTree/part/templates/part/subcategories.html b/InvenTree/part/templates/part/subcategories.html
index abf61d743e..c503d5504c 100644
--- a/InvenTree/part/templates/part/subcategories.html
+++ b/InvenTree/part/templates/part/subcategories.html
@@ -12,7 +12,9 @@
     {% if child.description %}
     <i> - {{ child.description }}</i>
     {% endif %}
-    <span class='badge'>{{ child.partcount }}</span>
+    {% if child.partcount > 0 %}
+    <span class='badge'>{{ child.partcount }} Part{% if child.partcount > 1 %}s{% endif %}</span>
+    {% endif %}
 </li>
 {% endfor %}
 </ul>
diff --git a/InvenTree/stock/templates/stock/location_list.html b/InvenTree/stock/templates/stock/location_list.html
index 9ce7a1814c..a6e1811f46 100644
--- a/InvenTree/stock/templates/stock/location_list.html
+++ b/InvenTree/stock/templates/stock/location_list.html
@@ -8,7 +8,9 @@ Sub-Locations<span class='badge'>{{ children|length }}</span>
 <ul class="list-group">
 {% for child in children %}
 <li class="list-group-item"><a href="{% url 'stock-location-detail' child.id %}">{{ child.name }}</a> - <i>{{ child.description }}</i>
-    <span class='badge'>{{ child.item_count }}</span>
+    {% if child.item_count > 0 %}
+    <span class='badge'>{{ child.item_count }} Item{% if child.item_count > 1 %}s{% endif %}</span>
+    {% endif %}
 </li>
 {% endfor %}
 </ul>