[Admin Tools | Trunk]: Add on scripts new FAQs page.

This commit is contained in:
Konstantinos Triantafyllou 2020-04-24 16:39:09 +00:00
parent c65b205365
commit 5d10423c40
2 changed files with 32 additions and 3 deletions

View File

@ -45,6 +45,7 @@ print("\n\n Initialize entities and pages\n\n")
// Other Pages for Connect
db.page.save({"name" : "About - Learn How", "route" : "/about/learn-how", "type" : "other", "connect":true,"communities":false,"openaire":false,"entities" : [], "top":true,"bottom":false,"right":false,"left":false});
db.page.save({"name" : "About - Learn in depth", "route" : "/about/learn-in-depth", "type" : "other", "connect":true,"communities":false,"openaire":false,"entities" : [], "top":true,"bottom":false,"right":false,"left":false});
db.page.save({"name" : "About - FAQs", "route" : "/about/faq", "type" : "other", "connect":true,"communities":false,"openaire":false,"entities" : [], "top":true,"bottom":false,"right":false,"left":false});
db.page.save({"name" : "Contact us", "route" : "/contact-us", "type" : "other", "connect":true,"communities":false,"openaire":false,"entities" : [], "top":false,"bottom":false,"right":true,"left":false});
db.page.save({"name" : "Content Policy", "route" : "/content", "type" : "other", "connect":true,"communities":false,"openaire":false,"entities" : [], "top":true,"bottom":false,"right":false,"left":false});

View File

@ -1559,6 +1559,31 @@ function removeContentPolicyPageAndAddHelpTextInCommunitiesSourcesPage() {
}
}
function addFAQsPage() {
db.page.save({"name" : "About - FAQs",
"route" : "/about/faq",
"type" : "other",
"connect":true,
"communities":false,
"openaire":false,
"entities" : [],
"top":true,
"bottom":false,
"right":false,
"left":false
});
faq = db.page.find( { route: "/about/faq" }).map( function(page) { return page._id.str; } ).toString();
communities = db.community.find().map( function(community) { return community; } );
for (var i = 0; i < communities.length; i++) {
community_pages = communities[i].pages;
community_pages[faq] = true;
community_pid = communities[i].pid;
db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
print("Update pages for " + community_pid);
}
}
use openaire_admin;
//updatePages();
@ -1626,6 +1651,9 @@ use openaire_admin;
//addSearchResearchOutcomesPages();
// 10-04-2020
createNewPagesForConnect();
createNewPagesForCommunities();
removeContentPolicyPageAndAddHelpTextInCommunitiesSourcesPage();
// createNewPagesForConnect();
// createNewPagesForCommunities();
// removeContentPolicyPageAndAddHelpTextInCommunitiesSourcesPage();
//24-04-2020
addFAQsPage();