mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
30 lines
802 B
JavaScript
30 lines
802 B
JavaScript
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
var AppsRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, {
|
|
titleToken: 'Apps',
|
|
|
|
classNames: ['settings-view-apps'],
|
|
|
|
beforeModel: function () {
|
|
if (!this.get('config.apps')) {
|
|
return this.transitionTo('settings.general');
|
|
}
|
|
|
|
return this.get('session.user')
|
|
.then(this.transitionAuthor())
|
|
.then(this.transitionEditor());
|
|
},
|
|
|
|
model: function () {
|
|
return this.store.find('app');
|
|
},
|
|
|
|
renderTemplate: function () {
|
|
this.render('settings/apps', {into: 'application'});
|
|
}
|
|
});
|
|
|
|
export default AppsRoute;
|