Merge pull request #3698 from FinnStutzenstein/topPagination
Proposal for top pagenavigation
This commit is contained in:
commit
71b3cc181f
@ -129,6 +129,7 @@ Core:
|
|||||||
easier development [#3566].
|
easier development [#3566].
|
||||||
- Reset scroll level for each new projection [#3686].
|
- Reset scroll level for each new projection [#3686].
|
||||||
- Scroll to top on every state change [#3689].
|
- Scroll to top on every state change [#3689].
|
||||||
|
- Added pagination on top of lists [#3698].
|
||||||
|
|
||||||
Mediafiles:
|
Mediafiles:
|
||||||
- New form for uploading multiple files [#3650].
|
- New form for uploading multiple files [#3650].
|
||||||
|
@ -173,7 +173,7 @@ angular.module('OpenSlidesApp.agenda.site', [
|
|||||||
};
|
};
|
||||||
|
|
||||||
// pagination
|
// pagination
|
||||||
$scope.pagination = osTablePagination.createInstance('AgendaTablePagination');
|
$scope.pagination = osTablePagination.createInstance('AgendaTablePagination', 50);
|
||||||
|
|
||||||
// parse duration for inline editing
|
// parse duration for inline editing
|
||||||
$scope.generateDurationText = function (item) {
|
$scope.generateDurationText = function (item) {
|
||||||
|
@ -170,8 +170,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-6" ng-show="itemsFiltered.length > pagination.itemsPerPage">
|
<div class="col-md-6" ng-show="itemsFiltered.length > pagination.itemsPerPage">
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
|
<a href="" class="pagination-arrow" ng-click="pagination.prevPage()"
|
||||||
|
ng-if="pagination.showPrevPageArrow()">
|
||||||
|
«
|
||||||
|
</a>
|
||||||
<translate>Page</translate> {{ pagination.currentPage }} /
|
<translate>Page</translate> {{ pagination.currentPage }} /
|
||||||
{{ Math.ceil(itemsFiltered.length/pagination.itemsPerPage) }}
|
{{ pagination.getPageCount(itemsFiltered) }}
|
||||||
|
<a href="" class="pagination-arrow" ng-click="pagination.nextPage(itemsFiltered)"
|
||||||
|
ng-if="pagination.showNextPageArrow(itemsFiltered)">
|
||||||
|
»
|
||||||
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,8 +67,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-6" ng-show="assignmentsFiltered.length > pagination.itemsPerPage">
|
<div class="col-md-6" ng-show="assignmentsFiltered.length > pagination.itemsPerPage">
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
|
<a href="" class="pagination-arrow" ng-click="pagination.prevPage()"
|
||||||
|
ng-if="pagination.showPrevPageArrow()">
|
||||||
|
«
|
||||||
|
</a>
|
||||||
<translate>Page</translate> {{ pagination.currentPage }} /
|
<translate>Page</translate> {{ pagination.currentPage }} /
|
||||||
{{ Math.ceil(assignmentsFiltered.length/pagination.itemsPerPage) }}
|
{{ pagination.getPageCount(assignmentsFiltered) }}
|
||||||
|
<a href="" class="pagination-arrow" ng-click="pagination.nextPage(assignmentsFiltered)"
|
||||||
|
ng-if="pagination.showNextPageArrow(assignmentsFiltered)">
|
||||||
|
»
|
||||||
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -209,6 +209,16 @@ tr.selected td {
|
|||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pagination-arrow {
|
||||||
|
font-size: 150%;
|
||||||
|
padding: 3px;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
&:hover, &:focus {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.grey {
|
.grey {
|
||||||
color: #9a9898;
|
color: #9a9898;
|
||||||
}
|
}
|
||||||
|
@ -650,6 +650,31 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
self.save();
|
self.save();
|
||||||
$rootScope.gotoTop();
|
$rootScope.gotoTop();
|
||||||
};
|
};
|
||||||
|
self.getPageCount = function (objs) {
|
||||||
|
if (objs) {
|
||||||
|
return Math.ceil(objs.length/self.itemsPerPage);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
self.showNextPageArrow = function (objs) {
|
||||||
|
if (objs) {
|
||||||
|
return self.currentPage != self.getPageCount(objs);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
self.showPrevPageArrow = function () {
|
||||||
|
return self.currentPage != 1;
|
||||||
|
};
|
||||||
|
self.nextPage = function (objs) {
|
||||||
|
if (objs && self.currentPage < self.getPageCount(objs)) {
|
||||||
|
self.currentPage++;
|
||||||
|
self.pageChanged();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
self.prevPage = function () {
|
||||||
|
if (self.currentPage > 1) {
|
||||||
|
self.currentPage--;
|
||||||
|
self.pageChanged();
|
||||||
|
}
|
||||||
|
};
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -146,8 +146,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-6" ng-show="mediafilesFiltered.length > pagination.itemsPerPage">
|
<div class="col-md-6" ng-show="mediafilesFiltered.length > pagination.itemsPerPage">
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
|
<a href="" class="pagination-arrow" ng-click="pagination.prevPage()"
|
||||||
|
ng-if="pagination.showPrevPageArrow()">
|
||||||
|
«
|
||||||
|
</a>
|
||||||
<translate>Page</translate> {{ pagination.currentPage }} /
|
<translate>Page</translate> {{ pagination.currentPage }} /
|
||||||
{{ Math.ceil(mediafilesFiltered.length/pagination.itemsPerPage) }}
|
{{ pagination.getPageCount(mediafilesFiltered) }}
|
||||||
|
<a href="" class="pagination-arrow" ng-click="pagination.nextPage(mediafilesFiltered)"
|
||||||
|
ng-if="pagination.showNextPageArrow(mediafilesFiltered)">
|
||||||
|
»
|
||||||
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -128,8 +128,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-6" ng-show="motionsFiltered.length > pagination.itemsPerPage">
|
<div class="col-md-6" ng-show="motionsFiltered.length > pagination.itemsPerPage">
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
|
<a href="" class="pagination-arrow" ng-click="pagination.prevPage()"
|
||||||
|
ng-if="pagination.showPrevPageArrow()">
|
||||||
|
«
|
||||||
|
</a>
|
||||||
<translate>Page</translate> {{ pagination.currentPage }} /
|
<translate>Page</translate> {{ pagination.currentPage }} /
|
||||||
{{ Math.ceil(motionsFiltered.length/pagination.itemsPerPage) }}
|
{{ pagination.getPageCount(motionsFiltered) }}
|
||||||
|
<a href="" class="pagination-arrow" ng-click="pagination.nextPage(motionsFiltered)"
|
||||||
|
ng-if="pagination.showNextPageArrow(motionsFiltered)">
|
||||||
|
»
|
||||||
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -149,8 +149,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-6" ng-show="usersFiltered.length > pagination.itemsPerPage">
|
<div class="col-md-6" ng-show="usersFiltered.length > pagination.itemsPerPage">
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
|
<a href="" class="pagination-arrow" ng-click="pagination.prevPage()"
|
||||||
|
ng-if="pagination.showPrevPageArrow()">
|
||||||
|
«
|
||||||
|
</a>
|
||||||
<translate>Page</translate> {{ pagination.currentPage }} /
|
<translate>Page</translate> {{ pagination.currentPage }} /
|
||||||
{{ Math.ceil(usersFiltered.length/pagination.itemsPerPage) }}
|
{{ pagination.getPageCount(usersFiltered) }}
|
||||||
|
<a href="" class="pagination-arrow" ng-click="pagination.nextPage(usersFiltered)"
|
||||||
|
ng-if="pagination.showNextPageArrow(usersFiltered)">
|
||||||
|
»
|
||||||
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user