Handlers: set page title

这个提交包含在:
2019-09-29 21:34:53 +02:00
父节点 ec10c764d5
当前提交 d9de46354e
共有 11 个文件被更改,包括 20 次插入1 次删除

查看文件

@@ -35,6 +35,7 @@ void Handler::setGeneralVars(TemplatePage &page)
Response Handler::errorResponse(std::string errortitle, std::string errormessage, int status)
{
TemplatePage &error = this->templ->getPage("error");
error.setVar("title", createPageTitle(errortitle));
error.setVar("errortitle", errortitle);
error.setVar("errormessage", errormessage);
// TODO: log?
@@ -42,6 +43,11 @@ Response Handler::errorResponse(std::string errortitle, std::string errormessage
return {status, error.render()};
}
std::string Handler::createPageTitle(std::string append)
{
return this->handlersConfig->wikiname + " - " + append; // TODO: we might wanna make the format configurable
}
QueryOption Handler::queryOption(const Request &r) const
{
QueryOption result;