4 #include <rikitiki/rikitiki>
5 #include <rikitiki/configuration/configuration>
6 #include <rikitiki/ctemplate/ctemplate>
8 using namespace rikitiki;
9 using namespace rikitiki::ctemplates;
27 void Register(
Server& server){
37 ctemplate::TemplateDictionary td(
"commands.tpl");
38 for(
unsigned int i = 0;i < ctx.server->handlers.size();i++){
39 if(ctx.server->handlers[i]->visible()){
40 ctemplate::TemplateDictionary* row = td.AddSectionDictionary(
"HANDLER");
41 row->SetValue(
"name", ctx.server->handlers[i]->name());
42 row->SetValue(
"description", ctx.server->handlers[i]->desc());
48 void makePage(
ConnContext& ctx,
const std::string& message){
49 ctemplate::TemplateDictionary td(
"example.tpl");
50 td.SetValue(
"message", message.size() ? message :
"You didn't enter anything!");
55 makePage(ctx, ctx.Post()[
"message"]);
59 makePage(ctx,
"Please enter a message below");
63 ctx << ContentType::application_javascript
65 for(
auto param : ctx.QueryString()){
66 ctx <<
"\t '" << param.first <<
"': '" << param.second <<
"', \n";