2014-10-28 08:29:42 -06:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-07-25 00:52:17 -07:00
|
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
2014-09-23 13:04:49 +00:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
|
2014-10-28 08:29:42 -06:00
|
|
|
var AppsRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
2014-11-25 12:56:08 -08:00
|
|
|
titleToken: 'Apps',
|
|
|
|
|
2014-09-23 13:04:49 +00:00
|
|
|
classNames: ['settings-view-apps'],
|
2014-07-25 00:52:17 -07:00
|
|
|
|
2014-06-23 17:01:43 +01:00
|
|
|
beforeModel: function () {
|
|
|
|
if (!this.get('config.apps')) {
|
2014-07-25 00:52:17 -07:00
|
|
|
return this.transitionTo('settings.general');
|
2014-06-23 17:01:43 +01:00
|
|
|
}
|
2014-07-25 00:52:17 -07:00
|
|
|
|
|
|
|
return this.currentUser()
|
|
|
|
.then(this.transitionAuthor())
|
|
|
|
.then(this.transitionEditor());
|
2014-06-23 17:01:43 +01:00
|
|
|
},
|
2014-10-24 21:09:50 +00:00
|
|
|
|
2014-05-28 08:57:55 +02:00
|
|
|
model: function () {
|
|
|
|
return this.store.find('app');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default AppsRoute;
|