2015-05-25 19:00:42 +03:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
|
2015-05-26 21:24:32 +03:00
|
|
|
var AboutRoute = AuthenticatedRoute.extend(styleBody, {
|
2015-05-25 19:00:42 +03:00
|
|
|
titleToken: 'About',
|
|
|
|
|
|
|
|
classNames: ['view-about'],
|
|
|
|
|
|
|
|
cachedConfig: false,
|
|
|
|
model: function () {
|
|
|
|
var cachedConfig = this.get('cachedConfig'),
|
|
|
|
self = this;
|
|
|
|
if (cachedConfig) {
|
|
|
|
return cachedConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ic.ajax.request(this.get('ghostPaths.url').api('configuration'))
|
|
|
|
.then(function (configurationResponse) {
|
|
|
|
var configKeyValues = configurationResponse.configuration;
|
|
|
|
cachedConfig = {};
|
|
|
|
configKeyValues.forEach(function (configKeyValue) {
|
|
|
|
cachedConfig[configKeyValue.key] = configKeyValue.value;
|
|
|
|
});
|
|
|
|
self.set('cachedConfig', cachedConfig);
|
|
|
|
return cachedConfig;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
renderTemplate: function () {
|
|
|
|
this.render('about', {into: 'application'});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default AboutRoute;
|