diff --git a/HEADS b/HEADS index 3f52622..18df193 100644 --- a/HEADS +++ b/HEADS @@ -1 +1 @@ -{"engine": {"master": "9b78fb066e5c22c8b173609aaa0f06e50ab3fb3f"}} \ No newline at end of file +{"engine": {"master": "b8b2d5a3a6ce3556ee465290260ce0a902e1a40a"}} \ No newline at end of file diff --git a/app/buildings/building_controller.cpp b/app/buildings/building_controller.cpp index 61f8e5d..6889fd5 100644 --- a/app/buildings/building_controller.cpp +++ b/app/buildings/building_controller.cpp @@ -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()); + 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) { + Vector > 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(); } diff --git a/app/buildings/building_controller.h b/app/buildings/building_controller.h index fd2b704..588c19a 100644 --- a/app/buildings/building_controller.h +++ b/app/buildings/building_controller.h @@ -23,6 +23,7 @@ public: bool admin_full_render(); void admin_render_building_list(Request *request); + void admin_render_building(Request *request, Ref building); void migrate(); virtual void add_default_data();