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