2016-04-11 22:38:59 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const page = require('page');
|
2016-04-14 20:28:44 +02:00
|
|
|
const settings = require('../settings.js');
|
2016-04-11 22:38:59 +02:00
|
|
|
const topNavController = require('../controllers/top_nav_controller.js');
|
|
|
|
const SettingsView = require('../views/settings_view.js');
|
|
|
|
|
|
|
|
class SettingsController {
|
|
|
|
constructor() {
|
|
|
|
this.settingsView = new SettingsView();
|
|
|
|
}
|
|
|
|
|
|
|
|
registerRoutes() {
|
|
|
|
page('/settings', (ctx, next) => { this.settingsRoute(); });
|
|
|
|
}
|
|
|
|
|
|
|
|
settingsRoute() {
|
|
|
|
topNavController.activate('settings');
|
|
|
|
this.settingsView.render({
|
2016-04-14 20:28:44 +02:00
|
|
|
getSettings: () => settings.getSettings(),
|
|
|
|
saveSettings: newSettings => settings.saveSettings(newSettings),
|
2016-04-11 22:38:59 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = new SettingsController();
|