diff --git a/inventory/templates/inventory/distributor_detail.html b/inventory/templates/inventory/distributor_detail.html index 6df6208..5dbd787 100644 --- a/inventory/templates/inventory/distributor_detail.html +++ b/inventory/templates/inventory/distributor_detail.html @@ -95,70 +95,9 @@

Items

- - - - - - - - - - - - - - {% for item in items %} - - - - - - - - {% endfor %} - -
NameDescriptionContainerManufacturer
{{ item.name }} - {% if item.documentation.all %} - - {% endif %} - {% if user.is_staff %} - - {% endif %} - {{ item.description }}{{ item.container.display_name }} - {% if item.manufacturer %} - - {% if item.manufacturer.icon %}{% endif %}{{ item.manufacturer.name }} - - {% else %} - - - {% endif %} -
- - + {% url 'distributor-detail' distributor.id as this_url %} + {% include "inventory/pagination.html" with url=this_url id="paginator_top" param="item" paginator=items %} + {% include "inventory/item_list.html" with items=items show_manufacturer=1 %} + {% include "inventory/pagination.html" with url=this_url id="paginator_top" param="item" paginator=items %} {% endblock %} \ No newline at end of file diff --git a/inventory/templates/inventory/item_list.html b/inventory/templates/inventory/item_list.html new file mode 100644 index 0000000..694c1b4 --- /dev/null +++ b/inventory/templates/inventory/item_list.html @@ -0,0 +1,58 @@ +{% load static %} + + + + + + + + + {% if show_manufacturer %} + + {% endif %} + {% if show_distributor %} + + {% endif %} + + + + {% for item in items %} + + + + + + {% if show_manufacturer %} + + {% endif %} + {% if show_distributor %} + + {% endif %} + + + {% endfor %} + +
NameDescriptionContainerManufacturerDistributor
{{ item.name }} + {% if item.documentation.all %} + + {% endif %} + {% if user.is_staff %} + + {% endif %} + {{ item.description }}{{ item.container.display_name }} + {% if item.manufacturer %} + + {% if item.manufacturer.icon %}{% endif %}{{ item.manufacturer.name }} + + {% else %} + - + {% endif %} + + {% if item.distributor %} + + {% if item.distributor.icon %}{% endif %}{{ item.distributor.name }} + + {% else %} + - + {% endif %} +
diff --git a/inventory/templates/inventory/manufacturer_detail.html b/inventory/templates/inventory/manufacturer_detail.html index b220af5..c5c675a 100644 --- a/inventory/templates/inventory/manufacturer_detail.html +++ b/inventory/templates/inventory/manufacturer_detail.html @@ -62,70 +62,9 @@

Items

- - - - - - - - - - - - - - {% for item in items %} - - - - - - - - {% endfor %} - -
NameDescriptionContainerDistributor
{{ item.name }} - {% if item.documentation.all %} - - {% endif %} - {% if user.is_staff %} - - {% endif %} - {{ item.description }}{{ item.container.display_name }} - {% if item.distributor %} - - {% if item.distributor.icon %}{% endif %}{{ item.distributor.name }} - - {% else %} - - - {% endif %} -
- - + {% url 'manufacturer-detail' manufacturer.id as this_url %} + {% include "inventory/pagination.html" with url=this_url id="paginator_top" param="item" paginator=items %} + {% include "inventory/item_list.html" with items=items show_distributor=1 %} + {% include "inventory/pagination.html" with url=this_url id="paginator_bottom" param="item" paginator=items %} {% endblock %} \ No newline at end of file diff --git a/inventory/templates/inventory/pagination.html b/inventory/templates/inventory/pagination.html new file mode 100644 index 0000000..bd8a29e --- /dev/null +++ b/inventory/templates/inventory/pagination.html @@ -0,0 +1,15 @@ +{% load static %} + +