mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/routing: move routing to controllers
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const page = require('page');
|
||||
const topNavController = require('../controllers/top_nav_controller.js');
|
||||
const HelpView = require('../views/help_view.js');
|
||||
|
||||
@ -8,6 +9,13 @@ class HelpController {
|
||||
this.helpView = new HelpView();
|
||||
}
|
||||
|
||||
registerRoutes() {
|
||||
page('/help', () => { this.showHelpRoute(); });
|
||||
page(
|
||||
'/help/:section',
|
||||
(ctx, next) => { this.showHelpRoute(ctx.params.section); });
|
||||
}
|
||||
|
||||
showHelpRoute(section) {
|
||||
topNavController.activate('help');
|
||||
this.helpView.render(section);
|
||||
|
Reference in New Issue
Block a user