diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html index f9bac157a8..26040d0fc6 100644 --- a/InvenTree/build/templates/build/detail.html +++ b/InvenTree/build/templates/build/detail.html @@ -275,13 +275,8 @@ {% if build.has_tracked_bom_items %} - - - + {% include "expand_rows.html" with label="outputs" %} + {% include "collapse_rows.html" with label="outputs" %} {% endif %} {% include "filter_list.html" with id='incompletebuilditems' %} diff --git a/InvenTree/order/templates/order/sales_order_detail.html b/InvenTree/order/templates/order/sales_order_detail.html index 89346c8118..2b4d28b064 100644 --- a/InvenTree/order/templates/order/sales_order_detail.html +++ b/InvenTree/order/templates/order/sales_order_detail.html @@ -86,6 +86,8 @@ {% if roles.sales_order.change %}
+ {% include "expand_rows.html" with label="pending-shipments" %} + {% include "collapse_rows.html" with label="pending-shipments" %} {% include "filter_list.html" with id="pending-shipments" %}
@@ -102,6 +104,8 @@
+ {% include "expand_rows.html" with label="completed-shipments" %} + {% include "collapse_rows.html" with label="completed-shipments" %} {% include "filter_list.html" with id="completed-shipments" %}
diff --git a/InvenTree/templates/collapse_rows.html b/InvenTree/templates/collapse_rows.html new file mode 100644 index 0000000000..f9fb454268 --- /dev/null +++ b/InvenTree/templates/collapse_rows.html @@ -0,0 +1,5 @@ +{% load i18n %} + + diff --git a/InvenTree/templates/expand_rows.html b/InvenTree/templates/expand_rows.html new file mode 100644 index 0000000000..bf6ac54425 --- /dev/null +++ b/InvenTree/templates/expand_rows.html @@ -0,0 +1,5 @@ +{% load i18n %} + + diff --git a/InvenTree/templates/js/translated/order.js b/InvenTree/templates/js/translated/order.js index 4bc9bcb9cd..52ff8c12ee 100644 --- a/InvenTree/templates/js/translated/order.js +++ b/InvenTree/templates/js/translated/order.js @@ -2540,6 +2540,17 @@ function loadSalesOrderShipmentTable(table, options={}) { setupFilterList('salesordershipment', $(table), options.filter_target); + // Add callbacks for expand / collapse buttons + var prefix = options.shipped ? 'completed' : 'pending'; + + $(`#${prefix}-shipments-expand`).click(function() { + $(table).bootstrapTable('expandAllRows'); + }); + + $(`#${prefix}-shipments-collapse`).click(function() { + $(table).bootstrapTable('collapseAllRows'); + }); + function makeShipmentActions(row) { // Construct "actions" for the given shipment row var pk = row.pk;