mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 09:52:09 +03:00
0e9d4e6792
Refs #4001 - grunt-jscs@0.8.1 which provides ES6 support.
24 lines
849 B
JavaScript
24 lines
849 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 necessary 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.filter('users', function (user) {
|
|
return /^active|warn-[1-4]|locked$/.test(user.get('status'));
|
|
}),
|
|
|
|
invitedUsers: Ember.computed.filter('users', function (user) {
|
|
var status = user.get('status');
|
|
|
|
return status === 'invited' || status === 'invited-pending';
|
|
})
|
|
});
|
|
|
|
export default UsersIndexController;
|