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