From cf2abb413017d47b31f009e95ec4d5c2beb7e2c2 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 19 Sep 2019 23:20:42 +1000 Subject: [PATCH] Add option to display ALL results in a paginated table - Commonize the number of pages allowed --- InvenTree/InvenTree/static/script/inventree/part.js | 3 ++- InvenTree/InvenTree/static/script/inventree/stock.js | 3 ++- InvenTree/company/templates/company/detail_part.html | 1 + InvenTree/company/templates/company/index.html | 1 + InvenTree/part/templates/part/build.html | 1 + InvenTree/templates/InvenTree/search.html | 6 ++++-- InvenTree/templates/InvenTree/settings/currency.html | 3 ++- InvenTree/templates/InvenTree/settings/part.html | 3 ++- 8 files changed, 15 insertions(+), 6 deletions(-) diff --git a/InvenTree/InvenTree/static/script/inventree/part.js b/InvenTree/InvenTree/static/script/inventree/part.js index 1056a7706b..16eec9e293 100644 --- a/InvenTree/InvenTree/static/script/inventree/part.js +++ b/InvenTree/InvenTree/static/script/inventree/part.js @@ -198,7 +198,8 @@ function loadPartTable(table, url, options={}) { sortName: 'name', method: 'get', pagination: true, - pageSize: 25, + pageSize: 50, + pageList: [25, 50, 100, 'all'], rememberOrder: true, formatNoMatches: function() { return "No parts found"; }, queryParams: function(p) { diff --git a/InvenTree/InvenTree/static/script/inventree/stock.js b/InvenTree/InvenTree/static/script/inventree/stock.js index ae07be1dd3..589969faaf 100644 --- a/InvenTree/InvenTree/static/script/inventree/stock.js +++ b/InvenTree/InvenTree/static/script/inventree/stock.js @@ -47,7 +47,8 @@ function loadStockTable(table, options) { search: true, method: 'get', pagination: true, - pageSize: 25, + pageSize: 50, + pageList: [25, 50, 100, 'all'], rememberOrder: true, formatNoMatches: function() { return 'No stock items matching query'; diff --git a/InvenTree/company/templates/company/detail_part.html b/InvenTree/company/templates/company/detail_part.html index 2cc100390b..3a24140464 100644 --- a/InvenTree/company/templates/company/detail_part.html +++ b/InvenTree/company/templates/company/detail_part.html @@ -50,6 +50,7 @@ search: true, pagination: true, pageSize: 50, + pageList: [25, 50, 100, 'all'], formatNoMatches: function() { return "No supplier parts found for {{ company.name }}"; }, queryParams: function(p) { return { diff --git a/InvenTree/company/templates/company/index.html b/InvenTree/company/templates/company/index.html index 17b737b670..c77c705ad5 100644 --- a/InvenTree/company/templates/company/index.html +++ b/InvenTree/company/templates/company/index.html @@ -37,6 +37,7 @@ InvenTree | Supplier List search: true, pagination: true, pageSize: 50, + pageList: [25, 50, 100, 'all'], formatNoMatches: function() { return "No company information found"; }, columns: [ { diff --git a/InvenTree/part/templates/part/build.html b/InvenTree/part/templates/part/build.html index 958a057409..d6510e5123 100644 --- a/InvenTree/part/templates/part/build.html +++ b/InvenTree/part/templates/part/build.html @@ -36,6 +36,7 @@ search: true, pagination: true, pageSize: 50, + pageList: [25, 50, 100, 'all'], queryParams: function(p) { return { part: {{ part.id }}, diff --git a/InvenTree/templates/InvenTree/search.html b/InvenTree/templates/InvenTree/search.html index a31e4ed1a8..97285ddfd5 100644 --- a/InvenTree/templates/InvenTree/search.html +++ b/InvenTree/templates/InvenTree/search.html @@ -140,7 +140,8 @@ InvenTree | Search Results search: "{{ query }}", }, pagination: true, - pageSize: 25, + pageSize: 50, + pageList: [25, 50, 100, 'all'], search: true, columns: [ { @@ -163,7 +164,8 @@ InvenTree | Search Results search: "{{ query }}", }, pagination: true, - pageSize: 25, + pageSize: 50, + pageList: [25, 50, 100, 'all'], search: true, columns: [ { diff --git a/InvenTree/templates/InvenTree/settings/currency.html b/InvenTree/templates/InvenTree/settings/currency.html index 712cd1700c..dcdafb72ac 100644 --- a/InvenTree/templates/InvenTree/settings/currency.html +++ b/InvenTree/templates/InvenTree/settings/currency.html @@ -27,7 +27,8 @@ sortable: true, search: true, pagination: true, - pageSize: 25, + pageSize: 50, + pageList: [25, 50, 100, 'all'], formatNoMatches: function() { return "No currencies found"; }, rowStyle: function(row, index) { if (row.base) { diff --git a/InvenTree/templates/InvenTree/settings/part.html b/InvenTree/templates/InvenTree/settings/part.html index 87535c7db1..5f624063c1 100644 --- a/InvenTree/templates/InvenTree/settings/part.html +++ b/InvenTree/templates/InvenTree/settings/part.html @@ -27,7 +27,8 @@ sortable: true, search: true, pagination: true, - pageSize: 25, + pageSize: 50, + pageList: [25, 50, 100, 'all'], formatNoMatches: function() { return "No part parameter templates found"; }, columns: [ {