2015-02-13 07:22:32 +03:00
|
|
|
import Ember from 'ember';
|
2014-07-20 20:42:03 +04:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
const {Controller, computed, inject} = Ember;
|
|
|
|
const {alias, filter} = computed;
|
2014-07-20 20:42:03 +04:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
export default Controller.extend({
|
2015-10-18 21:17:02 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
session: inject.service(),
|
2014-07-02 07:44:39 +04:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
users: alias('model'),
|
|
|
|
|
|
|
|
activeUsers: filter('users', function (user) {
|
2014-07-23 10:13:20 +04:00
|
|
|
return /^active|warn-[1-4]|locked$/.test(user.get('status'));
|
|
|
|
}),
|
2014-07-02 07:44:39 +04:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
invitedUsers: filter('users', function (user) {
|
|
|
|
let status = user.get('status');
|
2014-07-23 10:13:20 +04:00
|
|
|
|
|
|
|
return status === 'invited' || status === 'invited-pending';
|
|
|
|
})
|
2014-07-02 07:44:39 +04:00
|
|
|
});
|