2014-10-28 17:29:42 +03:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-05-15 00:47:05 +04:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-06-05 07:18:23 +04:00
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
2014-05-15 00:47:05 +04:00
|
|
|
|
2014-10-28 17:29:42 +03:00
|
|
|
var DebugRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, {
|
2014-05-15 00:47:05 +04:00
|
|
|
classNames: ['settings'],
|
2014-06-09 06:05:40 +04:00
|
|
|
|
2014-10-29 23:28:36 +03:00
|
|
|
beforeModel: function (transition) {
|
|
|
|
this._super(transition);
|
|
|
|
|
2014-07-23 23:30:18 +04:00
|
|
|
var self = this;
|
|
|
|
this.store.find('user', 'me').then(function (user) {
|
|
|
|
if (user.get('isAuthor') || user.get('isEditor')) {
|
|
|
|
self.transitionTo('posts');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2014-05-15 00:47:05 +04:00
|
|
|
model: function () {
|
2014-10-25 01:09:50 +04:00
|
|
|
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) {
|
2014-06-23 18:24:37 +04:00
|
|
|
return records.get('firstObject');
|
|
|
|
});
|
2014-04-08 02:01:46 +04:00
|
|
|
}
|
2014-07-23 23:30:18 +04:00
|
|
|
|
2014-04-08 02:01:46 +04:00
|
|
|
});
|
2014-06-23 18:24:37 +04:00
|
|
|
|
|
|
|
export default DebugRoute;
|