Handlers: set page title
Этот коммит содержится в:
@@ -27,13 +27,14 @@ Response HandlerHistory::handleRequest(const Request &r)
|
||||
{
|
||||
QueryOption qo = queryOption(r);
|
||||
std::string page = r.get("page");
|
||||
|
||||
std::string title;
|
||||
if(page.empty())
|
||||
{
|
||||
if(!this->userSession->user.permissions.canSeeGlobalHistory())
|
||||
{
|
||||
return errorResponse("Permission denied", "You can't see the changes history on this wiki", 403);
|
||||
}
|
||||
title = "History";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -42,6 +43,7 @@ Response HandlerHistory::handleRequest(const Request &r)
|
||||
{
|
||||
return errorResponse("Permission denied", "You cannot see the changes history of this page", 403);
|
||||
}
|
||||
title = "History: " + page;
|
||||
}
|
||||
|
||||
unsigned int count = 0;
|
||||
@@ -113,6 +115,7 @@ Response HandlerHistory::handleRequest(const Request &r)
|
||||
unsigned int neworder = (qo.order == DESCENDING) ? ASCENDING : DESCENDING;
|
||||
historyPage.setVar("linkrecentsort", makeSortedLink(qo.limit, qo.offset, neworder));
|
||||
historyPage.setVar("revisionlist", this->templ->renderRevisionList(resultList, page.empty()));
|
||||
historyPage.setVar("title", createPageTitle(title));
|
||||
Response response;
|
||||
response.setBody(historyPage.render());
|
||||
response.setStatus(200);
|
||||
|
Ссылка в новой задаче
Block a user