Merge branch 'master' of ssh.dev.azure.com:v3/HackKu/HackKu%202020/backend
This commit is contained in:
commit
c105c78f9b
@ -61,7 +61,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-3 navsec">
|
<div class="col-sm-3 navsec">
|
||||||
<nav class="navbar navbar-dark bg-dark flex-column">
|
<nav class="navbar navbar-dark bg-dark flex-column">
|
||||||
<a class="navbar-brand" href="#"><img src="/logo/Asset+1.svg" width="30" height="30" class="d-inline-block align-top" alt="">Noded</a>
|
<a class="navbar-brand" href="#"><img src="https://hack20.glmdev.tech/assets/logo/3x/logo3x.png" width="30" height="30" class="d-inline-block align-top" alt="">Noded</a>
|
||||||
<div class="nav nav-pills flex-column">
|
<div class="nav nav-pills flex-column">
|
||||||
%%SIDEBAR%%
|
%%SIDEBAR%%
|
||||||
</div>
|
</div>
|
||||||
|
@ -23,7 +23,7 @@ class Export extends Controller {
|
|||||||
const pages = await Page.find({ OrgUserId: user._id })
|
const pages = await Page.find({ OrgUserId: user._id })
|
||||||
|
|
||||||
const ExportData = {}
|
const ExportData = {}
|
||||||
for (const page of pages) {
|
for (const page of pages) { //for all pages of the user, generate a copy of the data
|
||||||
const nodes = await Node.find({ PageId: page.UUID })
|
const nodes = await Node.find({ PageId: page.UUID })
|
||||||
|
|
||||||
const PageData = { ...page }
|
const PageData = { ...page }
|
||||||
@ -84,7 +84,7 @@ class Export extends Controller {
|
|||||||
const Page = this.models.get('api:Page')
|
const Page = this.models.get('api:Page')
|
||||||
const Node = this.models.get('api:Node')
|
const Node = this.models.get('api:Node')
|
||||||
const user = req.user
|
const user = req.user
|
||||||
const pages = await Page.find({ OrgUserId: user._id })
|
const pages = await Page.find({ OrgUserId: user._id, ParentId: { $ne: '0' } })
|
||||||
const mapping = {} //keeps track of html file UUID and file name
|
const mapping = {} //keeps track of html file UUID and file name
|
||||||
const page0 = await user.get_root_page() //topmost page
|
const page0 = await user.get_root_page() //topmost page
|
||||||
|
|
||||||
@ -121,12 +121,12 @@ class Export extends Controller {
|
|||||||
const Node = this.models.get('api:Node')
|
const Node = this.models.get('api:Node')
|
||||||
const virt_root = await user.get_root_page()
|
const virt_root = await user.get_root_page()
|
||||||
return await this._sidebar_recurse(mapping, virt_root)
|
return await this._sidebar_recurse(mapping, virt_root)
|
||||||
|
|
||||||
}
|
}
|
||||||
async _sidebar_recurse(mapping, parent) {
|
async _sidebar_recurse(mapping, parent) {
|
||||||
const Page = this.models.get('api:Page')
|
const Page = this.models.get('api:Page')
|
||||||
const Node = this.models.get('api:Node')
|
const Node = this.models.get('api:Node')
|
||||||
const children = await Page.find({ ParentId : parent.UUID})
|
const children = await Page.find({ ParentId: parent.UUID })
|
||||||
let base = ''
|
let base = ''
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
if (child.ChildPageIds.length === 0) {
|
if (child.ChildPageIds.length === 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user