2014-07-25 11:52:17 +04:00
|
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
|
|
|
|
|
|
|
var AppsRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, CurrentUserSettings, {
|
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-07-25 11:52:17 +04:00
|
|
|
|
2014-05-28 10:57:55 +04:00
|
|
|
model: function () {
|
|
|
|
return this.store.find('app');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default AppsRoute;
|