mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
a8ca517c54
closes #3222 - implementing server-side pagination for /users API - passing /users?limit=none will return all users - passing /users?status=invited will filter base on user status - creating 3 mixins (route, controller and view) to keep pagination logic DRY - updating route, controller and view for Posts to use new mixing - implementing infinite scrolling for Users Management screen (using new mixins) - Users Management screen displays all invited users, but paginates active users
17 lines
691 B
JavaScript
17 lines
691 B
JavaScript
import PaginationControllerMixin from 'ghost/mixins/pagination-controller';
|
|
|
|
var UsersIndexController = Ember.ArrayController.extend(PaginationControllerMixin, {
|
|
init: function () {
|
|
//let the PaginationControllerMixin know what type of model we will be paginating
|
|
//this is necesariy because we do not have access to the model inside the Controller::init method
|
|
this._super({'modelType': 'user'});
|
|
},
|
|
|
|
users: Ember.computed.alias('model'),
|
|
|
|
activeUsers: Ember.computed.filterBy('users', 'active', true).property('users'),
|
|
|
|
invitedUsers: Ember.computed.filterBy('users', 'invited', true).property('users')
|
|
});
|
|
|
|
export default UsersIndexController;
|