From 13c5834f2cde707078d65f427247f3267d111749 Mon Sep 17 00:00:00 2001 From: Allan SIMON Date: Sun, 11 Aug 2013 18:59:57 +0800 Subject: [PATCH] re #77 started to work on the issue, we wil have for that an admin panel, for the moment added only the auto-generated code --- app/src/TatoWiki.cpp | 3 ++ app/src/TatoWiki.h | 2 ++ app/src/contents/Admin.h | 36 +++++++++++++++++++ app/src/controllers/webs/Admin.cpp | 47 ++++++++++++++++++++++++ app/src/controllers/webs/Admin.h | 57 ++++++++++++++++++++++++++++++ 5 files changed, 145 insertions(+) create mode 100644 app/src/contents/Admin.h create mode 100644 app/src/controllers/webs/Admin.cpp create mode 100644 app/src/controllers/webs/Admin.h diff --git a/app/src/TatoWiki.cpp b/app/src/TatoWiki.cpp index b19dec6..06dd98f 100644 --- a/app/src/TatoWiki.cpp +++ b/app/src/TatoWiki.cpp @@ -39,6 +39,8 @@ namespace apps { TatoWiki::TatoWiki(cppcms::service &serv) : cppcms::application(serv), //%%%NEXT_MAIN_APP_CTRL_CONSTRUCT_MARKER%%% + admin(serv), + search(serv), media(serv), @@ -72,6 +74,7 @@ TatoWiki::TatoWiki(cppcms::service &serv) : add(img,"^/img(.*)",1); add(media,"^/media(.*)",1); add(search,"^/search(.*)",1); + add(admin,"^/admin(.*)",1); //%%%NEXT_CONTROLLER_DISPATCHER_MARKER%%%, do not delete add(pages, "/(.*)", 1); diff --git a/app/src/TatoWiki.h b/app/src/TatoWiki.h index c2bd8ae..58fd1b2 100644 --- a/app/src/TatoWiki.h +++ b/app/src/TatoWiki.h @@ -29,6 +29,7 @@ #include "controllers/webs/History.h" #include "controllers/webs/Media.h" #include "controllers/webs/Search.h" +#include "controllers/webs/Admin.h" //%%%NEXT_CONTROLLER_INCLUDE_MARKER%%%, do not delete #include "controllers/webs/Pages.h" @@ -46,6 +47,7 @@ class TatoWiki : public cppcms::application { private: //%%%NEXT_MAIN_APP_CTRL_ATTR%%% + controllers::webs::Admin admin; controllers::webs::Search search; controllers::webs::Media media; controllers::webs::Img img; diff --git a/app/src/contents/Admin.h b/app/src/contents/Admin.h new file mode 100644 index 0000000..62e635d --- /dev/null +++ b/app/src/contents/Admin.h @@ -0,0 +1,36 @@ +/** + * Tatoeba wiki Wiki made with cppcmsskel + * + * Copyright (C) 2013 Allan SIMON + * See accompanying file COPYING.TXT file for licensing details. + * + * @category Tatoeba wiki + * @package Contents + * @author Allan SIMON + * @link https://github.com/allan-simon/tatowiki + */ + +#ifndef TATOWIKI_CONTENTS_ADMIN_H +#define TATOWIKI_CONTENTS_ADMIN_H + +#include "cppcms_skel/contents/content.h" + +//%%%NEXT_CONTENT_FORM_INCLUDE_MARKER%%% + +namespace contents { +namespace admin { + +/** + * @class Admin + * @brief Base content for every action of Admin controller + * @since 10 August 2013 + */ +struct Admin : public BaseContent { +}; + +//%%%NEXT_CONTENT_MARKER%%% + +} // end of namespace admin +} //end of namespace contents + +#endif diff --git a/app/src/controllers/webs/Admin.cpp b/app/src/controllers/webs/Admin.cpp new file mode 100644 index 0000000..e4fef15 --- /dev/null +++ b/app/src/controllers/webs/Admin.cpp @@ -0,0 +1,47 @@ +/** + * Tatoeba wiki Wiki made with cppcmsskel + * + * Copyright (C) 2012 Allan SIMON + * See accompanying file COPYING.TXT file for licensing details. + * + * @category Tatoeba wiki + * @package Controllers + * @author Allan SIMON + * @link https://github.com/allan-simon/tatowiki + */ + +#include +#include "Admin.h" + + +#include "contents/Admin.h" + +//%%%NEXT_INC_MODEL_CTRL_MARKER%%% + + +namespace controllers { +namespace webs { + +Admin::Admin(cppcms::service& serv) : + controllers::webs::Controller(serv) +{ + + //%%%NEXT_ACTION_DISPATCHER_MARKER%%%, do not delete + + //%%%NEXT_NEW_MODEL_CTRL_MARKER%%% +} + +/** + * + */ +Admin::~Admin() { + //%%%NEXT_DEL_MODEL_CTRL_MARKER%%% +} + +// %%%NEXT_ACTION_MARKER%%% , do not delete + + + + +} // End namespace webs +} // End namespace controllers diff --git a/app/src/controllers/webs/Admin.h b/app/src/controllers/webs/Admin.h new file mode 100644 index 0000000..81d85a8 --- /dev/null +++ b/app/src/controllers/webs/Admin.h @@ -0,0 +1,57 @@ +/** + * Tatoeba wiki Wiki made with cppcmsskel + * + * Copyright (C) 2012 Allan SIMON + * See accompanying file COPYING.TXT file for licensing details. + * + * @category Tatoeba wiki + * @package Controllers + * @author Allan SIMON + * @link https://github.com/allan-simon/tatowiki + */ + +#ifndef TATOWIKICONTROLLERS_WEBS_ADMIN_H +#define TATOWIKICONTROLLERS_WEBS_ADMIN_H + +#include "cppcms_skel/controllers/webs/Controller.h" + + +//needed to avoid to include models directly here, +//which would have the side effects to require to recompile the +// controller every time we modify a model. even though it does +// not affect the controller +namespace models { + // %%%NEXT_CLASS_MODEL_CTRL_MARKER%%% +} + +namespace controllers { +namespace webs { +/** + * @class Admin @TODO add a description + * @since 10 August 2013 + */ +class Admin : public Controller { + public: + /** + * @brief Constructor + * @since 10 August 2013 + */ + Admin(cppcms::service &serv); + + /** + * @brief Destructor + * @since 10 August 2013 + */ + ~Admin(); + + private: + // %%%NEXT_VAR_MODEL_CTRL_MARKER%%% + +// %%%NEXT_ACTION_MARKER%%% , do not delete + +}; + +} // End namespace webs +} // End namespace controllers + +#endif