Used better pagination for agenda, motions and users.

to increase the browser performance while switching between apps.
This commit is contained in:
Emanuel Schütze 2017-01-25 16:19:02 +01:00
parent 70f5a95be1
commit df3e691734
7 changed files with 31 additions and 7 deletions

View File

@ -140,7 +140,7 @@ angular.module('OpenSlidesApp.agenda.site', [
// pagination
$scope.currentPage = 1;
$scope.itemsPerPage = 100;
$scope.itemsPerPage = 25;
$scope.limitBegin = 0;
$scope.pageChanged = function() {
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;

View File

@ -215,8 +215,8 @@
ng-repeat="item in itemsFiltered = (items
| osFilter: filter.filterString : filter.getObjectQueryString
| filter: {closed: filter.booleanFilters.closed.value}
| filter: {is_hidden: filter.booleanFilters.is_hidden.value}
| limitTo : itemsPerPage : limitBegin)">
| filter: {is_hidden: filter.booleanFilters.is_hidden.value})
| limitTo : itemsPerPage : limitBegin">
<!-- select column -->
<div ng-show="isSelectMode" os-perms="agenda.can_manage" class="col-xs-1 centered">

View File

@ -21,7 +21,7 @@ angular.module('OpenSlidesApp.motions.csv', [])
];
_.forEach(motions, function (motion) {
var row = [];
row.push('"' + motion.identifier + '"');
row.push('"' + motion.identifier !== null ? motion.identifier : '' + '"');
row.push('"' + motion.getTitle() + '"');
row.push('"' + motion.getText() + '"');
row.push('"' + motion.getReason() + '"');

View File

@ -770,6 +770,15 @@ angular.module('OpenSlidesApp.motions.site', [
display_name: gettext('Last modified')},
];
// pagination
$scope.currentPage = 1;
$scope.itemsPerPage = 25;
$scope.limitBegin = 0;
$scope.pageChanged = function() {
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;
};
// update state
$scope.updateState = function (motion, state_id) {
$http.put('/rest/motions/motion/' + motion.id + '/set_state/', {'state': state_id});
@ -1564,7 +1573,7 @@ angular.module('OpenSlidesApp.motions.site', [
// All user objects are already loaded via the resolve statement from ui-router.
var users = User.getAll();
angular.forEach(users, function (user) {
if (user.short_name == motion.submitter) {
if (user.short_name == motion.submitter.trim()) {
motion.submitters_id = [user.id];
motion.submitter = User.get(user.id).full_name;
}

View File

@ -419,7 +419,8 @@
| MultiselectFilter: filter.multiselectFilters.recommendation : getItemId.recommendation
| MultiselectFilter: filter.multiselectFilters.tag : getItemId.tag
| toArray
| orderBy: sort.column : sort.reverse)">
| orderBy: sort.column : sort.reverse)
| limitTo : itemsPerPage : limitBegin">
<!-- select column -->
<div ng-show="isSelectMode" os-perms="motions.can_manage" class="col-xs-1 centered">
@ -659,5 +660,18 @@
</div>
</div> <!-- data row -->
<ul uib-pagination
ng-show="motionsFiltered.length > itemsPerPage"
total-items="motionsFiltered.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> <!-- container -->
</div> <!-- details -->

View File

@ -503,7 +503,7 @@ angular.module('OpenSlidesApp.users.site', [
// pagination
$scope.currentPage = 1;
$scope.itemsPerPage = 100;
$scope.itemsPerPage = 25;
$scope.limitBegin = 0;
$scope.pageChanged = function() {
$scope.limitBegin = ($scope.currentPage - 1) * $scope.itemsPerPage;

View File

@ -419,6 +419,7 @@
</div><!-- end os-table -->
<ul uib-pagination
ng-show="usersFiltered.length > itemsPerPage"
total-items="usersFiltered.length"
items-per-page="itemsPerPage"
ng-model="currentPage"