tree: visible => listed
This commit is contained in:
@ -53,7 +53,7 @@ std::string Handler::createPageTitle(std::string title)
|
||||
QueryOption Handler::queryOption(const Request &r, SORT_ORDER defaultSort) const
|
||||
{
|
||||
QueryOption result;
|
||||
result.includeInvisible = false;
|
||||
result.includeUnlisted = false;
|
||||
try
|
||||
{
|
||||
result.limit = utils::toUInt(r.get("limit"));
|
||||
|
@ -9,7 +9,7 @@ std::vector<HandlerFeedGenerator::EntryRevisionPair> HandlerFeedGenerator::fetch
|
||||
|
||||
std::vector<EntryRevisionPair> result;
|
||||
QueryOption option;
|
||||
option.includeInvisible = false;
|
||||
option.includeUnlisted = true;
|
||||
// option.limit = 20;
|
||||
|
||||
auto comppage = [](const Page &a, const Page &b) { return a.name < b.name; };
|
||||
@ -34,12 +34,15 @@ std::vector<HandlerFeedGenerator::EntryRevisionPair> HandlerFeedGenerator::fetch
|
||||
}
|
||||
for(const Page &member : members)
|
||||
{
|
||||
Permissions perms = permissionDao->find(member.name, this->userSession->user.login)
|
||||
.value_or(this->userSession->user.permissions);
|
||||
if(perms.canRead())
|
||||
if(member.feedlisted)
|
||||
{
|
||||
auto revision = revisionDao->getRevisionForPage(member.name, 1).value();
|
||||
result.push_back({member, revision});
|
||||
Permissions perms = permissionDao->find(member.name, this->userSession->user.login)
|
||||
.value_or(this->userSession->user.permissions);
|
||||
if(perms.canRead())
|
||||
{
|
||||
auto revision = revisionDao->getRevisionForPage(member.name, 1).value();
|
||||
result.push_back({member, revision});
|
||||
}
|
||||
}
|
||||
}
|
||||
std::sort(result.begin(), result.end(),
|
||||
|
@ -76,7 +76,16 @@ Response HandlerPageEdit::handleRequest(PageDao &pageDao, std::string pagename,
|
||||
try
|
||||
{
|
||||
this->database->beginTransaction();
|
||||
|
||||
std::string visiblecmd = parser.extractCommand("visible", newContent);
|
||||
std::string listedcmd = parser.extractCommand("listed", newContent);
|
||||
/* Backwarts compatibility */
|
||||
if(listedcmd.empty())
|
||||
{
|
||||
listedcmd = visiblecmd;
|
||||
}
|
||||
std::string feedlistedcmd = parser.extractCommand("feedlisted", newContent);
|
||||
|
||||
std::string rename = parser.extractCommand("rename", newContent);
|
||||
std::string customtitle = parser.extractCommand("pagetitle", newContent);
|
||||
std::string parentpage = parser.extractCommand("parentpage", newContent);
|
||||
@ -139,7 +148,8 @@ Response HandlerPageEdit::handleRequest(PageDao &pageDao, std::string pagename,
|
||||
}
|
||||
|
||||
page.current_revision = current_revision;
|
||||
page.listed = !(visiblecmd == "0");
|
||||
page.listed = !(listedcmd == "0");
|
||||
page.feedlisted = !(feedlistedcmd == "0");
|
||||
page.name = pagename;
|
||||
page.title = customtitle;
|
||||
page.parentpage = parentpage;
|
||||
|
Verwijs in nieuw issue
Block a user