2016-03-19 21:37:04 +01:00
|
|
|
'use strict';
|
|
|
|
|
2016-04-06 21:49:26 +02:00
|
|
|
const page = require('page');
|
2016-04-01 00:20:34 +02:00
|
|
|
const topNavController = require('../controllers/top_nav_controller.js');
|
|
|
|
const HelpView = require('../views/help_view.js');
|
|
|
|
|
2016-03-19 21:37:04 +01:00
|
|
|
class HelpController {
|
2016-04-01 00:20:34 +02:00
|
|
|
constructor() {
|
|
|
|
this.helpView = new HelpView();
|
2016-03-19 21:37:04 +01:00
|
|
|
}
|
|
|
|
|
2016-04-06 21:49:26 +02:00
|
|
|
registerRoutes() {
|
|
|
|
page('/help', () => { this.showHelpRoute(); });
|
|
|
|
page(
|
|
|
|
'/help/:section',
|
|
|
|
(ctx, next) => { this.showHelpRoute(ctx.params.section); });
|
|
|
|
}
|
|
|
|
|
2016-03-29 12:34:10 +02:00
|
|
|
showHelpRoute(section) {
|
2016-04-01 00:20:34 +02:00
|
|
|
topNavController.activate('help');
|
2016-04-08 10:35:38 +02:00
|
|
|
this.helpView.render({
|
|
|
|
section: section,
|
|
|
|
});
|
2016-03-19 21:37:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-01 00:20:34 +02:00
|
|
|
module.exports = new HelpController();
|