mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
c3bb7cb396
No Issue - Routes, views and controllers updated for about page - fix up tests and add redirect check
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
var AboutRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, {
|
|
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;
|