mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
2048110167
issue #5434 - move users routes/views/controllers out of settings - rename users team - update nav-menu.hbs - remove legacy routes - fix up tests
25 lines
874 B
JavaScript
25 lines
874 B
JavaScript
import Ember from 'ember';
|
|
import PaginationControllerMixin from 'ghost/mixins/pagination-controller';
|
|
|
|
var TeamIndexController = 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 TeamIndexController;
|