Merge pull request #3393 from FinnStutzenstein/Issue3389

Pagination for assingment list (fixes #3389)
This commit is contained in:
Emanuel Schütze 2017-09-08 21:57:25 +02:00 committed by GitHub
commit 62f0f23228
3 changed files with 29 additions and 2 deletions

View File

@ -40,6 +40,9 @@ Motions:
- Added multiselect filter for motion comments [#3372].
- Added support for pinning personal notes to the window [#3360].
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

View File

@ -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;

View File

@ -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">
<!-- select column -->
<div ng-show="isSelectMode" os-perms="assignments.can_manage" class="col-xs-1 centered">
@ -321,6 +322,19 @@
</div>
</div>
</div> <!-- main table -->
</div> <!-- end container -->
<ul uib-pagination
ng-show="assignmentsFiltered.length > itemsPerPage"
total-items="assignmentsFiltered.length"
items-per-page="itemsPerPage"
ng-model="currentPage"
ng-change="pageChanged()"
class="pagination-sm"
direction-links="false"
boundary-links="true"
first-text="&laquo;"
last-text="&raquo;">
</ul>
</div> <!-- end container -->
</div>