From dc03a672811fe03eaed45e30518a6b45f105bda3 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Tue, 5 Sep 2017 15:41:54 +0200 Subject: [PATCH] Pagination for assingment list (fixes #3389) --- CHANGELOG | 3 +++ .../assignments/static/js/assignments/site.js | 10 ++++++++++ .../templates/assignments/assignment-list.html | 18 ++++++++++++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2a9a79cf5..63b735887 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -39,6 +39,9 @@ Motions: - Added inline Editing for motion reason [#3361]. - Added multiselect filter for motion comments [#3372]. +Elections: +- Added pagination for list view [#3393]. + Users: - User without permission to see users can now see agenda item speakers, motion submitters and supporters, assignment candidates, mediafile diff --git a/openslides/assignments/static/js/assignments/site.js b/openslides/assignments/static/js/assignments/site.js index 25ab1cc86..14d9f9b74 100644 --- a/openslides/assignments/static/js/assignments/site.js +++ b/openslides/assignments/static/js/assignments/site.js @@ -317,6 +317,7 @@ angular.module('OpenSlidesApp.assignments.site', [ tag: function (assignment) {return assignment.tags_id;}, phase: function (assignment) {return assignment.phase;}, }; + // Sorting $scope.sort = osTableSort.createInstance(); $scope.sort.column = 'title'; @@ -343,6 +344,15 @@ angular.module('OpenSlidesApp.assignments.site', [ } Assignment.save(assignment); }; + + // Pagination + $scope.currentPage = 1; + $scope.itemsPerPage = 25; + $scope.limitBegin = 0; + $scope.pageChanged = function() { + $scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage; + }; + // update phase $scope.updatePhase = function (assignment, phase_id) { assignment.phase = phase_id; diff --git a/openslides/assignments/static/templates/assignments/assignment-list.html b/openslides/assignments/static/templates/assignments/assignment-list.html index 46f1a8405..a2ed96a6a 100644 --- a/openslides/assignments/static/templates/assignments/assignment-list.html +++ b/openslides/assignments/static/templates/assignments/assignment-list.html @@ -208,7 +208,8 @@ | osFilter: filter.filterString : filter.getObjectQueryString | MultiselectFilter: filter.multiselectFilters.tag : getItemId.tag | MultiselectFilter: filter.multiselectFilters.phase : getItemId.phase - | orderBy: sort.column : sort.reverse)"> + | orderBy: sort.column : sort.reverse) + | limitTo : itemsPerPage : limitBegin">
@@ -321,6 +322,19 @@
- + + +