Merge pull request #2907 from emanuelschuetze/pagination
Used better pagination for agenda, motions and users.
This commit is contained in:
commit
8897e22df0
@ -141,7 +141,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;
|
||||
|
@ -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">
|
||||
|
@ -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() + '"');
|
||||
|
@ -771,6 +771,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});
|
||||
@ -1565,7 +1574,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;
|
||||
}
|
||||
|
@ -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="«"
|
||||
last-text="»">
|
||||
</ul>
|
||||
|
||||
</div> <!-- container -->
|
||||
</div> <!-- details -->
|
||||
|
@ -504,7 +504,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;
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user