2021-01-21 12:11:51 +03:00
|
|
|
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
|
|
|
|
|
|
export default class DashboardRoute extends AuthenticatedRoute {
|
2022-05-17 10:34:34 +03:00
|
|
|
async beforeModel() {
|
2021-02-24 17:33:00 +03:00
|
|
|
super.beforeModel(...arguments);
|
2021-08-04 13:22:19 +03:00
|
|
|
|
2022-02-02 12:12:16 +03:00
|
|
|
if (this.session.user.isContributor) {
|
|
|
|
return this.transitionTo('posts');
|
|
|
|
} else if (!this.session.user.isAdmin) {
|
2021-07-08 16:37:31 +03:00
|
|
|
return this.transitionTo('site');
|
|
|
|
}
|
2021-02-24 17:33:00 +03:00
|
|
|
}
|
|
|
|
|
2021-02-16 20:12:24 +03:00
|
|
|
buildRouteInfoMetadata() {
|
|
|
|
return {
|
|
|
|
mainClasses: ['gh-main-wide']
|
|
|
|
};
|
|
|
|
}
|
2021-02-23 17:34:13 +03:00
|
|
|
|
2022-05-17 10:34:34 +03:00
|
|
|
// trigger a background load of members plus labels for filter dropdown
|
2021-02-23 17:34:13 +03:00
|
|
|
setupController() {
|
2022-05-17 10:34:34 +03:00
|
|
|
super.setupController(...arguments);
|
|
|
|
}
|
|
|
|
|
|
|
|
model() {
|
|
|
|
return this.controllerFor('dashboard').loadSiteStatusTask.perform();
|
2021-02-23 17:34:13 +03:00
|
|
|
}
|
2021-01-21 12:11:51 +03:00
|
|
|
}
|