2022-01-17 13:05:27 +03:00
|
|
|
import AdminRoute from 'ghost-admin/routes/admin';
|
2021-10-18 15:46:29 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
|
2022-01-17 13:05:27 +03:00
|
|
|
export default AdminRoute.extend({
|
2021-10-18 15:46:29 +03:00
|
|
|
settings: service(),
|
|
|
|
|
|
|
|
beforeModel() {
|
|
|
|
this._super(...arguments);
|
|
|
|
|
|
|
|
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'
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|