mirror of
https://github.com/Relintai/wp_saver_rcpp_fw.git
synced 2024-11-10 00:52:12 +01:00
More cleanups.
This commit is contained in:
parent
3d5e5795a0
commit
1044749d2a
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,7 +12,6 @@ game/.prop_tool_temp/**
|
||||
|
||||
settings.ini
|
||||
|
||||
www/**
|
||||
data/**
|
||||
export/**
|
||||
release/**
|
||||
|
@ -36,35 +36,32 @@ void WPApplication::routing_middleware(Object *instance, Request *request) {
|
||||
return;
|
||||
}
|
||||
|
||||
HandlerInstance handler_data;
|
||||
handler_data.instance = instance;
|
||||
|
||||
if (request->get_path_segment_count() == 0) {
|
||||
handler_data.handler_func = index;
|
||||
request->handler_instance = app->index_func;
|
||||
} else {
|
||||
const std::string main_route = request->get_current_path_segment();
|
||||
|
||||
request->push_path();
|
||||
|
||||
if (main_route == "blog") {
|
||||
handler_data.handler_func = blog;
|
||||
request->handler_instance = app->blog_func;
|
||||
}
|
||||
}
|
||||
|
||||
if (!handler_data.handler_func) {
|
||||
if (!request->handler_instance.handler_func) {
|
||||
app->send_error(404, request);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
request->handler_instance = handler_data;
|
||||
request->next_stage();
|
||||
}
|
||||
|
||||
void WPApplication::setup_routes() {
|
||||
DWebApplication::setup_routes();
|
||||
|
||||
index_func = HandlerInstance(index);
|
||||
index_func = HandlerInstance(index, this);
|
||||
blog_func = HandlerInstance(blog, this);
|
||||
}
|
||||
|
||||
void WPApplication::setup_middleware() {
|
||||
@ -78,17 +75,14 @@ void WPApplication::compile_menu() {
|
||||
HTMLBuilder bh;
|
||||
|
||||
bh.meta()->charset_utf_8();
|
||||
bh.meta()->name("description")->content("RPG browsergame");
|
||||
bh.meta()->name("keywords")->content("RPG,browsergame,Mourne,game,play");
|
||||
bh.title();
|
||||
bh.w("Mourne");
|
||||
bh.w("WPSaver");
|
||||
bh.ctitle();
|
||||
|
||||
bh.link()->rel_stylesheet()->href("/css/base.css");
|
||||
bh.link()->rel_stylesheet()->href("/css/menu.css");
|
||||
bh.link()->rel_stylesheet()->href("site.css");
|
||||
bh.write_tag();
|
||||
|
||||
menu_head = bh.result;
|
||||
header = bh.result;
|
||||
|
||||
HTMLBuilder bf;
|
||||
|
||||
@ -108,5 +102,3 @@ WPApplication::WPApplication() :
|
||||
WPApplication::~WPApplication() {
|
||||
}
|
||||
|
||||
std::string WPApplication::menu_head = "";
|
||||
std::string WPApplication::footer = "";
|
||||
|
@ -4,6 +4,7 @@
|
||||
//#include "core/http/web_application.h"
|
||||
#include "core/object.h"
|
||||
#include "modules/drogon/web_application.h"
|
||||
#include "core/string.h"
|
||||
|
||||
#undef LOG_TRACE
|
||||
#undef LOG_WARN
|
||||
@ -27,8 +28,10 @@ public:
|
||||
WPApplication();
|
||||
~WPApplication();
|
||||
|
||||
static std::string menu_head;
|
||||
static std::string footer;
|
||||
HandlerInstance blog_func;
|
||||
|
||||
String header;
|
||||
String footer;
|
||||
};
|
||||
|
||||
#endif
|
0
www/site.css
Normal file
0
www/site.css
Normal file
Loading…
Reference in New Issue
Block a user