2016-03-19 21:37:04 +01:00
|
|
|
'use strict';
|
|
|
|
|
2016-06-14 10:31:48 +02:00
|
|
|
const topNavigation = require('../models/top_navigation.js');
|
2016-04-01 00:20:34 +02:00
|
|
|
const HelpView = require('../views/help_view.js');
|
|
|
|
|
2016-03-19 21:37:04 +01:00
|
|
|
class HelpController {
|
2016-06-14 10:31:48 +02:00
|
|
|
constructor(section, subsection) {
|
|
|
|
topNavigation.activate('help');
|
2016-07-13 21:50:07 +02:00
|
|
|
topNavigation.setTitle('Help');
|
2016-06-14 10:31:48 +02:00
|
|
|
this._helpView = new HelpView(section, subsection);
|
2016-03-19 21:37:04 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-14 10:31:48 +02:00
|
|
|
module.exports = router => {
|
|
|
|
router.enter('/help', (ctx, next) => {
|
|
|
|
new HelpController();
|
|
|
|
});
|
|
|
|
router.enter('/help/:section', (ctx, next) => {
|
2016-07-07 21:18:35 +02:00
|
|
|
new HelpController(ctx.parameters.section);
|
2016-06-14 10:31:48 +02:00
|
|
|
});
|
|
|
|
router.enter('/help/:section/:subsection', (ctx, next) => {
|
2016-07-07 21:18:35 +02:00
|
|
|
new HelpController(ctx.parameters.section, ctx.parameters.subsection);
|
2016-06-14 10:31:48 +02:00
|
|
|
});
|
|
|
|
};
|