2014-10-28 09:29:42 -05:00
|
|
|
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
2014-06-04 22:18:23 -05:00
|
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
2014-07-25 02:52:17 -05:00
|
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
2014-09-23 08:04:49 -05:00
|
|
|
import styleBody from 'ghost/mixins/style-body';
|
2014-11-12 15:35:41 -05:00
|
|
|
import ShortcutsRoute from 'ghost/mixins/shortcuts-route';
|
|
|
|
import ctrlOrCmd from 'ghost/utils/ctrl-or-cmd';
|
2014-09-23 08:04:49 -05:00
|
|
|
|
2014-11-12 15:35:41 -05:00
|
|
|
var shortcuts = {},
|
|
|
|
SettingsGeneralRoute;
|
|
|
|
|
|
|
|
shortcuts[ctrlOrCmd + '+s'] = {action: 'save'};
|
|
|
|
|
|
|
|
SettingsGeneralRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, CurrentUserSettings, ShortcutsRoute, {
|
2014-11-25 15:56:08 -05:00
|
|
|
titleToken: 'General',
|
|
|
|
|
2014-09-23 08:04:49 -05:00
|
|
|
classNames: ['settings-view-general'],
|
2014-07-25 02:52:17 -05:00
|
|
|
|
|
|
|
beforeModel: function () {
|
|
|
|
return this.currentUser()
|
|
|
|
.then(this.transitionAuthor())
|
|
|
|
.then(this.transitionEditor());
|
|
|
|
},
|
2014-03-20 21:55:32 -05:00
|
|
|
|
|
|
|
model: function () {
|
2014-10-24 16:09:50 -05:00
|
|
|
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) {
|
2014-06-19 21:29:49 -05:00
|
|
|
return records.get('firstObject');
|
2014-03-20 21:55:32 -05:00
|
|
|
});
|
2014-11-12 15:35:41 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
shortcuts: shortcuts,
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
save: function () {
|
|
|
|
this.get('controller').send('save');
|
|
|
|
}
|
2014-03-20 21:55:32 -05:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-06-19 21:29:49 -05:00
|
|
|
export default SettingsGeneralRoute;
|