More cleanups to the Root.

This commit is contained in:
Relintai 2022-01-09 17:08:25 +01:00
parent dbced4e371
commit 960dda09f2
2 changed files with 0 additions and 31 deletions

View File

@ -247,33 +247,6 @@ void MourneRoot::add_menu(Request *request, const MenuEntries index) {
request->footer = footer;
}
void MourneRoot::village_page_func(Request *request) {
add_menu(request, MENUENTRY_VILLAGE);
// dynamic_cast<ListPage *>(instance)->index(request);
request->body += "test";
request->compile_and_send_body();
}
void MourneRoot::user_page_func(Request *request) {
if (is_logged_in(request)) {
add_menu(request, MENUENTRY_SETTINGS);
}
UserController::get_singleton()->handle_request_main(request);
}
void MourneRoot::admin_page_func(Request *request) {
AdminPanel::get_singleton()->handle_request_main(request);
}
void MourneRoot::setup_routes() {
// index_func = HandlerInstance(index);
// main_route_map["village"] = HandlerInstance(village_page_func);
// main_route_map["user"] = HandlerInstance(user_page_func);
// main_route_map["admin"] = HandlerInstance(admin_page_func);
}
void MourneRoot::setup_middleware() {
_middlewares.push_back(Ref<SessionSetupMiddleware>(new SessionSetupMiddleware()));
_middlewares.push_back(Ref<UserSessionSetupMiddleware>(new UserSessionSetupMiddleware()));

View File

@ -52,11 +52,7 @@ public:
void add_menu(Request *request, const MenuEntries index);
void index(Request *request);
void village_page_func(Request *request);
void user_page_func(Request *request);
void admin_page_func(Request *request);
virtual void setup_routes();
virtual void setup_middleware();
virtual void migrate();