diff --git a/InvenTree/img_source/folder_closed.svg b/InvenTree/img_source/folder_closed.svg new file mode 100644 index 0000000000..6677688a3d --- /dev/null +++ b/InvenTree/img_source/folder_closed.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/InvenTree/img_source/folder_open.svg b/InvenTree/img_source/folder_open.svg new file mode 100644 index 0000000000..cb971d9034 --- /dev/null +++ b/InvenTree/img_source/folder_open.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 6ca25b6e5d..b1c9ac214e 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -20,6 +20,20 @@ class PartCategory(InvenTreeTree): verbose_name = "Part Category" verbose_name_plural = "Part Categories" + + @property + def partcount(self): + """ Return the total part count under this category + (including children of child categories) + """ + + count = self.parts.count() + + for child in self.children.all(): + count += child.partcount + + return count + """ @property def parts(self): diff --git a/InvenTree/part/templates/part/index.html b/InvenTree/part/templates/part/index.html index 2ddac344cc..f7d068dcbe 100644 --- a/InvenTree/part/templates/part/index.html +++ b/InvenTree/part/templates/part/index.html @@ -1,35 +1,32 @@ {% extends "base.html" %} +{% load static %} {% block content %} {% include "part/cat_link.html" with category=category %} {% if children|length > 0 %} - - - - - +Subcategories: + - - +
  • + {{ child.name }} - {{ child.description }} + {{ child.partcount }} +
  • {% endfor %} -
    SubcategoryDescription
    {{ child.name }}{{ child.description }}
    + {% endif %} {% if parts|length > 0 %} -

    Parts

    - +Parts: + - - +
  • + {{ part.name }} - {{ part.description }} +
  • {% endfor %} -
    {{ part.name }}{{ part.description }}
    -{% else %} -There are no parts in this category. + {% endif %} {% endblock %} diff --git a/InvenTree/static/css/inventree.css b/InvenTree/static/css/inventree.css index 24609839e7..bf57a207c5 100644 --- a/InvenTree/static/css/inventree.css +++ b/InvenTree/static/css/inventree.css @@ -1,10 +1,17 @@ table, th, td { border: 1px solid black; border-collapse: collapse; + margin-left: 5px; + margin-right: 5px; + margin-top: 10px; + margin-bottom: 10px; } th, td { - padding: 10px; + padding-top: 5px; + padding-bottom: 5px; + padding-left: 10px; + padding-right: 10px; } th { @@ -18,6 +25,13 @@ table tr:nth-child(odd) { background-color: #fff; } +.badge { + float: right; + background-color: #777; + color: #fff; + border-radius: 5px; +} + .part-thumb { width: 150px; height: 150px; diff --git a/InvenTree/stock/templates/stock/index.html b/InvenTree/stock/templates/stock/index.html index fe6809f0f3..1579bae304 100644 --- a/InvenTree/stock/templates/stock/index.html +++ b/InvenTree/stock/templates/stock/index.html @@ -5,17 +5,16 @@ {% include "stock/loc_link.html" with location=location %} {% if children|length > 0 %} - - +Storage locations: + - - +
  • {{ child.name }}
  • {% endfor %} -
    Sublocations
    {{ child.name }}
    + {% endif %} {% if items|length > 0 %} +Stock items:
    Item