mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 05:14:12 +03:00
a7845cfd70
refs #1993 - adds ctrl/cmd+s for save - adds config flag - adds icon on settings page, puts items in the right order - sorts out permissions for all settings pages with consistent configuration
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import AuthenticatedRoute from 'ghost/routes/authenticated';
|
|
import loadingIndicator from 'ghost/mixins/loading-indicator';
|
|
import CurrentUserSettings from 'ghost/mixins/current-user-settings';
|
|
import styleBody from 'ghost/mixins/style-body';
|
|
import ShortcutsRoute from 'ghost/mixins/shortcuts-route';
|
|
import ctrlOrCmd from 'ghost/utils/ctrl-or-cmd';
|
|
|
|
var shortcuts = {},
|
|
SettingsCodeInjectionRoute;
|
|
|
|
shortcuts[ctrlOrCmd + '+s'] = {action: 'save'};
|
|
|
|
SettingsCodeInjectionRoute = AuthenticatedRoute.extend(styleBody, loadingIndicator, CurrentUserSettings, ShortcutsRoute, {
|
|
classNames: ['settings-view-code'],
|
|
|
|
beforeModel: function () {
|
|
return this.currentUser()
|
|
.then(this.transitionAuthor())
|
|
.then(this.transitionEditor());
|
|
},
|
|
|
|
model: function () {
|
|
return this.store.find('setting', {type: 'blog,theme'}).then(function (records) {
|
|
return records.get('firstObject');
|
|
});
|
|
},
|
|
|
|
shortcuts: shortcuts,
|
|
|
|
actions: {
|
|
save: function () {
|
|
this.get('controller').send('save');
|
|
}
|
|
}
|
|
});
|
|
|
|
export default SettingsCodeInjectionRoute;
|