|
|
@ -15,7 +15,7 @@ module.exports = { |
|
|
|
buildBanners: async (options) => { |
|
|
|
buildBanners: async (options) => { |
|
|
|
const label = `/${options.board._id}/banners.html`; |
|
|
|
const label = `/${options.board._id}/banners.html`; |
|
|
|
const start = process.hrtime(); |
|
|
|
const start = process.hrtime(); |
|
|
|
const html = render(label, 'banners.pug', options, { |
|
|
|
const html = await render(label, 'banners.pug', options, { |
|
|
|
'name': `/${options.board._id}/banners.json`, |
|
|
|
'name': `/${options.board._id}/banners.json`, |
|
|
|
'data': options.board.banners |
|
|
|
'data': options.board.banners |
|
|
|
}); |
|
|
|
}); |
|
|
@ -31,7 +31,7 @@ module.exports = { |
|
|
|
options.board = await Boards.findOne(options.board); |
|
|
|
options.board = await Boards.findOne(options.board); |
|
|
|
} |
|
|
|
} |
|
|
|
const threads = await Posts.getCatalog(options.board._id); |
|
|
|
const threads = await Posts.getCatalog(options.board._id); |
|
|
|
const html = render(label, 'catalog.pug', { |
|
|
|
const html = await render(label, 'catalog.pug', { |
|
|
|
...options, |
|
|
|
...options, |
|
|
|
threads, |
|
|
|
threads, |
|
|
|
}, { |
|
|
|
}, { |
|
|
@ -53,7 +53,7 @@ module.exports = { |
|
|
|
if (!thread) { |
|
|
|
if (!thread) { |
|
|
|
return; //this thread may have been an OP that was deleted
|
|
|
|
return; //this thread may have been an OP that was deleted
|
|
|
|
} |
|
|
|
} |
|
|
|
const html = render(label, 'thread.pug', { |
|
|
|
const html = await render(label, 'thread.pug', { |
|
|
|
...options, |
|
|
|
...options, |
|
|
|
thread, |
|
|
|
thread, |
|
|
|
}, { |
|
|
|
}, { |
|
|
@ -72,7 +72,7 @@ module.exports = { |
|
|
|
if (!options.maxPage) { |
|
|
|
if (!options.maxPage) { |
|
|
|
options.maxPage = Math.min(Math.ceil((await Posts.getPages(options.board._id)) / 10), Math.ceil(options.board.settings.threadLimit/10)); |
|
|
|
options.maxPage = Math.min(Math.ceil((await Posts.getPages(options.board._id)) / 10), Math.ceil(options.board.settings.threadLimit/10)); |
|
|
|
} |
|
|
|
} |
|
|
|
const html = render(label, 'board.pug', { |
|
|
|
const html = await render(label, 'board.pug', { |
|
|
|
...options, |
|
|
|
...options, |
|
|
|
threads, |
|
|
|
threads, |
|
|
|
}, { |
|
|
|
}, { |
|
|
@ -126,7 +126,7 @@ module.exports = { |
|
|
|
const label = '/news.html'; |
|
|
|
const label = '/news.html'; |
|
|
|
const start = process.hrtime(); |
|
|
|
const start = process.hrtime(); |
|
|
|
const news = await News.find(); |
|
|
|
const news = await News.find(); |
|
|
|
const html = render('news.html', 'news.pug', { |
|
|
|
const html = await render('news.html', 'news.pug', { |
|
|
|
news |
|
|
|
news |
|
|
|
}); |
|
|
|
}); |
|
|
|
const end = process.hrtime(start); |
|
|
|
const end = process.hrtime(start); |
|
|
@ -149,7 +149,7 @@ module.exports = { |
|
|
|
if (!options.logs) { |
|
|
|
if (!options.logs) { |
|
|
|
options.logs = await Modlogs.findBetweenDate(options.board, options.startDate, options.endDate); |
|
|
|
options.logs = await Modlogs.findBetweenDate(options.board, options.startDate, options.endDate); |
|
|
|
} |
|
|
|
} |
|
|
|
const html = render(label, 'modlog.pug', { |
|
|
|
const html = await render(label, 'modlog.pug', { |
|
|
|
...options |
|
|
|
...options |
|
|
|
}); |
|
|
|
}); |
|
|
|
const end = process.hrtime(start); |
|
|
|
const end = process.hrtime(start); |
|
|
@ -181,7 +181,7 @@ module.exports = { |
|
|
|
await Modlogs.deleteOld(options.board, monthAgo); |
|
|
|
await Modlogs.deleteOld(options.board, monthAgo); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
const html = render(label, 'modloglist.pug', { |
|
|
|
const html = await render(label, 'modloglist.pug', { |
|
|
|
board: options.board, |
|
|
|
board: options.board, |
|
|
|
dates |
|
|
|
dates |
|
|
|
}); |
|
|
|
}); |
|
|
@ -198,7 +198,7 @@ module.exports = { |
|
|
|
Boards.boardSort(0, 20), //top 20 boards sorted by users, pph, total posts
|
|
|
|
Boards.boardSort(0, 20), //top 20 boards sorted by users, pph, total posts
|
|
|
|
Files.activeContent() //size ans number of files
|
|
|
|
Files.activeContent() //size ans number of files
|
|
|
|
]); |
|
|
|
]); |
|
|
|
const html = render('index.html', 'home.pug', { |
|
|
|
const html = await render('index.html', 'home.pug', { |
|
|
|
totalStats, |
|
|
|
totalStats, |
|
|
|
boards, |
|
|
|
boards, |
|
|
|
fileStats, |
|
|
|
fileStats, |
|
|
|