mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 03:12:54 +03:00
42166c8d9f
- Refactor to handle deprecations including removal of all Views, ArrayControllers, and ItemControllers.
23 lines
821 B
JavaScript
23 lines
821 B
JavaScript
import Ember from 'ember';
|
|
import PaginationControllerMixin from 'ghost/mixins/pagination-controller';
|
|
|
|
export default Ember.Controller.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';
|
|
})
|
|
});
|