Ghost/ghost/admin/app/routes/about.js

33 lines
888 B
JavaScript
Raw Normal View History

import AuthenticatedRoute from 'ghost-admin/routes/authenticated';
import injectService from 'ember-service/inject';
import styleBody from 'ghost-admin/mixins/style-body';
export default AuthenticatedRoute.extend(styleBody, {
titleToken: 'About',
classNames: ['view-about'],
ghostPaths: injectService(),
ajax: injectService(),
cachedConfig: false,
model() {
let cachedConfig = this.get('cachedConfig');
let configUrl = this.get('ghostPaths.url').api('configuration', 'about');
if (cachedConfig) {
return cachedConfig;
}
2016-01-18 18:37:14 +03:00
return this.get('ajax').request(configUrl)
.then((configurationResponse) => {
let [cachedConfig] = configurationResponse.configuration;
this.set('cachedConfig', cachedConfig);
return cachedConfig;
});
}
});