mirror of
https://github.com/Relintai/mourne_rcpp_fw.git
synced 2024-11-13 05:57:21 +01:00
Handle the "new" segment. Started work on admin_render_building.
This commit is contained in:
parent
da02282ef0
commit
fc4f384170
2
HEADS
2
HEADS
@ -1 +1 @@
|
||||
{"engine": {"master": "9b78fb066e5c22c8b173609aaa0f06e50ab3fb3f"}}
|
||||
{"engine": {"master": "b8b2d5a3a6ce3556ee465290260ce0a902e1a40a"}}
|
@ -7,7 +7,6 @@
|
||||
#include "core/http/request.h"
|
||||
#include "core/http/session_manager.h"
|
||||
|
||||
#include "building_model.h"
|
||||
#include "building_model.h"
|
||||
|
||||
void BuildingController::handle_request_default(Request *request) {
|
||||
@ -19,6 +18,9 @@ void BuildingController::admin_handle_request_main(Request *request) {
|
||||
if (seg == "") {
|
||||
admin_render_building_list(request);
|
||||
return;
|
||||
} else if (seg == "new") {
|
||||
admin_render_building(request, Ref<Building>());
|
||||
return;
|
||||
}
|
||||
|
||||
request->send_error(404);
|
||||
@ -74,6 +76,19 @@ void BuildingController::admin_render_building_list(Request *request) {
|
||||
request->body += b.result;
|
||||
}
|
||||
|
||||
void BuildingController::admin_render_building(Request *request, Ref<Building> building) {
|
||||
Vector<Ref<Building> > buildings = BuildingModel::get_singleton()->get_all();
|
||||
|
||||
HTMLBuilder b;
|
||||
|
||||
b.div("back")->f()->fa(request->get_url_root_parent(), "<--- Back")->cdiv();
|
||||
b.br();
|
||||
b.fdiv("top_menu", "Building Editor");
|
||||
b.br();
|
||||
b.div("top_menu")->f()->fa(request->get_url_root("new"), "Create New")->cdiv();
|
||||
b.br();
|
||||
}
|
||||
|
||||
void BuildingController::migrate() {
|
||||
BuildingModel::get_singleton()->migrate();
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ public:
|
||||
bool admin_full_render();
|
||||
|
||||
void admin_render_building_list(Request *request);
|
||||
void admin_render_building(Request *request, Ref<Building> building);
|
||||
|
||||
void migrate();
|
||||
virtual void add_default_data();
|
||||
|
Loading…
Reference in New Issue
Block a user