2014-10-28 09:29:42 -05:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-08-02 10:21:38 -05:00
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
2014-09-23 08:04:49 -05:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
|
|
|
2014-10-28 09:29:42 -05:00
|
|
|
var SettingsAboutRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, {
|
2014-09-23 08:04:49 -05:00
|
|
|
classNames: ['settings-view-about'],
|
2014-08-02 10:21:38 -05:00
|
|
|
|
|
|
|
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;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default SettingsAboutRoute;
|