Project

General

Profile

« Previous | Next » 

Revision 58550

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

View differences:

modules/uoa-admin-tools/trunk/update_db.js
1559 1559
  }
1560 1560
}
1561 1561

  
1562
function addFAQsPage() {
1563
  db.page.save({"name" : "About - FAQs",
1564
    "route" : "/about/faq",
1565
    "type" : "other",
1566
    "connect":true,
1567
    "communities":false,
1568
    "openaire":false,
1569
    "entities" : [],
1570
    "top":true,
1571
    "bottom":false,
1572
    "right":false,
1573
    "left":false
1574
  });
1575
  faq = db.page.find( { route: "/about/faq" }).map( function(page) { return page._id.str; } ).toString();
1576
  communities = db.community.find().map( function(community) { return community; } );
1577
  for (var i = 0; i < communities.length; i++) {
1578
    community_pages = communities[i].pages;
1579

  
1580
    community_pages[faq] = true;
1581
    community_pid = communities[i].pid;
1582
    db.community.update({ "pid" : community_pid },{$set: { "pages": community_pages}});
1583
    print("Update pages for " + community_pid);
1584
  }
1585
}
1586

  
1562 1587
use openaire_admin;
1563 1588

  
1564 1589
//updatePages();
......
1626 1651
//addSearchResearchOutcomesPages();
1627 1652

  
1628 1653
// 10-04-2020
1629
createNewPagesForConnect();
1630
createNewPagesForCommunities();
1631
removeContentPolicyPageAndAddHelpTextInCommunitiesSourcesPage();
1654
// createNewPagesForConnect();
1655
// createNewPagesForCommunities();
1656
// removeContentPolicyPageAndAddHelpTextInCommunitiesSourcesPage();
1657

  
1658
//24-04-2020
1659
addFAQsPage();
modules/uoa-admin-tools/trunk/init_db.js
45 45
  // Other Pages for Connect
46 46
  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});
47 47
  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});
48
  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});
48 49
  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});
49 50
  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});
50 51

  

Also available in: Unified diff