2014-05-14 15:47:05 -05:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-06-04 22:18:23 -05:00
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
2014-05-14 15:47:05 -05:00
|
|
|
|
2014-07-25 08:38:13 -05:00
|
|
|
var DebugRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, styleBody, loadingIndicator, {
|
2014-05-14 15:47:05 -05:00
|
|
|
classNames: ['settings'],
|
2014-06-08 21:05:40 -05:00
|
|
|
|
2014-07-23 14:30:18 -05:00
|
|
|
beforeModel: function () {
|
|
|
|
var self = this;
|
|
|
|
this.store.find('user', 'me').then(function (user) {
|
|
|
|
if (user.get('isAuthor') || user.get('isEditor')) {
|
|
|
|
self.transitionTo('posts');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2014-05-14 15:47:05 -05:00
|
|
|
model: function () {
|
2014-06-23 09:24:37 -05:00
|
|
|
return this.store.find('setting', { type: 'blog,theme' }).then(function (records) {
|
|
|
|
return records.get('firstObject');
|
|
|
|
});
|
2014-04-07 17:01:46 -05:00
|
|
|
}
|
2014-07-23 14:30:18 -05:00
|
|
|
|
2014-04-07 17:01:46 -05:00
|
|
|
});
|
2014-06-23 09:24:37 -05:00
|
|
|
|
|
|
|
export default DebugRoute;
|