diff --git a/js/apps/system/aardvark/frontend/js/collections/_paginatedCollection.js b/js/apps/system/aardvark/frontend/js/collections/_paginatedCollection.js index 0001154e4d..9db8d04555 100644 --- a/js/apps/system/aardvark/frontend/js/collections/_paginatedCollection.js +++ b/js/apps/system/aardvark/frontend/js/collections/_paginatedCollection.js @@ -38,6 +38,20 @@ return this.pagesize; }, + setPageSize: function(newPagesize) { + if (newPagesize === "all") { + this.pagesize = 'all'; + } + else { + try { + newPagesize = parseInt(newPagesize, 10); + this.pagesize = newPagesize; + } + catch (ignore) { + } + } + }, + setToFirst: function() { this.page = 0; }, diff --git a/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js b/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js index 55330425c7..13cc03e3b7 100644 --- a/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js +++ b/js/apps/system/aardvark/frontend/js/collections/arangoDocuments.js @@ -59,6 +59,10 @@ return query + parts.join(" &&"); }, + setPagesize: function(size) { + this.setPageSize(size); + }, + resetFilter: function() { this.filters = []; }, @@ -68,6 +72,7 @@ var self = this, query, bindVars, + tmp, queryObj; bindVars = { "@collection": this.collectionID, @@ -81,7 +86,16 @@ if (this.getTotal() < 10000) { query += " SORT TO_NUMBER(x._key) == 0 ? x._key : TO_NUMBER(x._key)"; } - query += " LIMIT @offset, @count RETURN x"; + if (bindVars.count !== 'all') { + query += " LIMIT @offset, @count RETURN x"; + } + else { + tmp = { + "@collection": this.collectionID + }; + bindVars = tmp; + query += " RETURN x"; + } queryObj = { query: query, diff --git a/js/apps/system/aardvark/frontend/js/templates/documentsView.ejs b/js/apps/system/aardvark/frontend/js/templates/documentsView.ejs index 44fda41750..f01feab843 100644 --- a/js/apps/system/aardvark/frontend/js/templates/documentsView.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/documentsView.ejs @@ -302,6 +302,17 @@
+
diff --git a/js/apps/system/aardvark/frontend/js/views/documentsView.js b/js/apps/system/aardvark/frontend/js/views/documentsView.js index d13dbc207d..3bf418f7a6 100644 --- a/js/apps/system/aardvark/frontend/js/views/documentsView.js +++ b/js/apps/system/aardvark/frontend/js/views/documentsView.js @@ -86,7 +86,8 @@ "click #confirmDeleteIndexBtn" : "deleteIndex", "click #documentsToolbar ul" : "resetIndexForms", "click #indexHeader #addIndex" : "toggleNewIndexView", - "click #indexHeader #cancelIndex" : "toggleNewIndexView" + "click #indexHeader #cancelIndex" : "toggleNewIndexView", + "change #documentSize" : "setPagesize" }, showSpinner: function() { @@ -105,6 +106,12 @@ $("#docImportModal").modal('hide'); }, + setPagesize: function() { + var size = $('#documentSize').find(":selected").val(); + this.collection.setPagesize(size); + this.collection.getDocuments(this.getDocsCallback.bind(this)); + }, + returnPressedHandler: function(event) { if (event.keyCode === 13) { if ($("#confirmDeleteBtn").attr("disabled") === false) { diff --git a/js/apps/system/aardvark/frontend/scss/_documentsView.scss b/js/apps/system/aardvark/frontend/scss/_documentsView.scss index a4f0dd66bd..1f8dbb0e2c 100644 --- a/js/apps/system/aardvark/frontend/scss/_documentsView.scss +++ b/js/apps/system/aardvark/frontend/scss/_documentsView.scss @@ -73,14 +73,14 @@ .docsFirstCol { @extend %docs-col-no-border; height: 26px; - width: 70%; + width: 80%; } .docsSecCol { @extend %docs-col-no-border; height: 26px; min-width: 400px !important; - width: 20%; + width: 10%; } .docsThirdCol { @@ -116,3 +116,8 @@ color: $c-breadcrumb-a-active-bread; } +.documents-size { + float: right; + margin-top: -58px; + width: 115px; +} diff --git a/js/apps/system/aardvark/frontend/scss/generated.css b/js/apps/system/aardvark/frontend/scss/generated.css index c5ca2afa3b..c86f6e4e26 100644 --- a/js/apps/system/aardvark/frontend/scss/generated.css +++ b/js/apps/system/aardvark/frontend/scss/generated.css @@ -6059,12 +6059,12 @@ table .sorting { .docsFirstCol { height: 26px; - width: 70%; } + width: 80%; } .docsSecCol { height: 26px; min-width: 400px !important; - width: 20%; } + width: 10%; } .docsThirdCol { height: 26px; } @@ -6087,3 +6087,8 @@ table .sorting { .breadcrumb a.activeBread { color: #b9d375; } + +.documents-size { + float: right; + margin-top: -58px; + width: 115px; }