2014-10-28 08:29:42 -06:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2015-04-14 16:04:16 +01:00
|
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
2014-07-20 12:42:03 -04:00
|
|
|
import PaginationRouteMixin from 'ghost/mixins/pagination-route';
|
2014-09-23 13:04:49 +00:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-07-20 12:42:03 -04:00
|
|
|
|
2015-06-30 14:21:03 +01:00
|
|
|
var paginationSettings;
|
2014-10-24 21:09:50 +00:00
|
|
|
|
|
|
|
paginationSettings = {
|
2014-07-20 12:42:03 -04:00
|
|
|
page: 1,
|
2014-07-23 06:13:20 +00:00
|
|
|
limit: 20,
|
2014-10-16 15:28:51 +00:00
|
|
|
status: 'active'
|
2014-07-20 12:42:03 -04:00
|
|
|
};
|
|
|
|
|
2015-06-30 14:21:03 +01:00
|
|
|
export default AuthenticatedRoute.extend(styleBody, CurrentUserSettings, PaginationRouteMixin, {
|
2015-05-25 13:17:10 -05:00
|
|
|
titleToken: 'Team',
|
2014-11-25 12:56:08 -08:00
|
|
|
|
2015-06-30 14:21:03 +01:00
|
|
|
classNames: ['view-team'],
|
2014-09-23 13:04:49 +00:00
|
|
|
|
2014-07-20 12:42:03 -04:00
|
|
|
setupController: function (controller, model) {
|
2014-07-23 06:13:20 +00:00
|
|
|
this._super(controller, model);
|
|
|
|
this.setupPagination(paginationSettings);
|
2014-07-20 12:42:03 -04:00
|
|
|
},
|
2014-07-01 23:44:39 -04:00
|
|
|
|
2015-06-17 00:24:01 +01:00
|
|
|
beforeModel: function (transition) {
|
|
|
|
this._super(transition);
|
2015-04-14 16:04:16 +01:00
|
|
|
},
|
|
|
|
|
2014-07-01 23:44:39 -04:00
|
|
|
model: function () {
|
2014-07-31 09:29:05 +01:00
|
|
|
var self = this;
|
2014-10-16 15:28:51 +00:00
|
|
|
|
|
|
|
return self.store.find('user', {limit: 'all', status: 'invited'}).then(function () {
|
2015-06-30 14:21:03 +01:00
|
|
|
return self.store.filter('user', paginationSettings, function () {
|
|
|
|
return true;
|
2014-07-31 09:29:05 +01:00
|
|
|
});
|
2014-07-20 12:42:03 -04:00
|
|
|
});
|
2014-08-02 20:49:56 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
reload: function () {
|
|
|
|
this.refresh();
|
|
|
|
}
|
2014-07-01 23:44:39 -04:00
|
|
|
}
|
|
|
|
});
|