mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
737db37175
- Restructured Admin so that Integrations becomes a subpage of Settings.
40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
|
|
import CurrentUserSettings from 'ghost-admin/mixins/current-user-settings';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default AuthenticatedRoute.extend(CurrentUserSettings, {
|
|
settings: service(),
|
|
|
|
beforeModel() {
|
|
this._super(...arguments);
|
|
this.transitionAuthor(this.session.user);
|
|
this.transitionEditor(this.session.user);
|
|
|
|
return this.settings.reload();
|
|
},
|
|
|
|
actions: {
|
|
save() {
|
|
this.controller.send('save');
|
|
},
|
|
|
|
willTransition(transition) {
|
|
let controller = this.controller;
|
|
let modelIsDirty = this.settings.get('hasDirtyAttributes');
|
|
|
|
if (modelIsDirty) {
|
|
transition.abort();
|
|
controller.send('toggleLeaveSettingsModal', transition);
|
|
return;
|
|
}
|
|
}
|
|
},
|
|
|
|
buildRouteInfoMetadata() {
|
|
return {
|
|
titleToken: 'AMP'
|
|
};
|
|
}
|
|
|
|
});
|