Pagination for assingment list (fixes #3389)

This commit is contained in:
FinnStutzenstein 2017-09-05 15:41:54 +02:00 committed by Emanuel Schütze
parent cd637a94c8
commit dc03a67281
3 changed files with 29 additions and 2 deletions

View File

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

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>