mirror of https://gitgud.io/fatchan/jschan.git
Early version of overboard, /all.html. Still needs a small cache and moderation changes to support moderating references #166
parent
79deff75d4
commit
0021ed02cc
7 changed files with 57 additions and 6 deletions
@ -0,0 +1,23 @@ |
||||
'use strict'; |
||||
|
||||
const Posts = require(__dirname+'/../../db/posts.js') |
||||
, cache = require(__dirname+'/../../redis.js') |
||||
, { overboardLimit } = require(__dirname+'/../../configs/main.js'); |
||||
|
||||
module.exports = async (req, res, next) => { |
||||
|
||||
let threads = []; |
||||
try { |
||||
threads = await Posts.getRecent(null, 1, overboardLimit, false); |
||||
} catch (err) { |
||||
return next(err); |
||||
} |
||||
|
||||
res |
||||
.set('Cache-Control', 'public, max-age=60') |
||||
.render('overboard', { |
||||
modview: true, |
||||
threads, |
||||
}); |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
extends ../layout.pug |
||||
include ../mixins/post.pug |
||||
|
||||
block head |
||||
title Overboard |
||||
|
||||
block content |
||||
.board-header |
||||
h1.board-title Overboard |
||||
h4.board-description Recently bumped threads from all boards |
||||
hr(size=1) |
||||
if threads.length === 0 |
||||
p No posts. |
||||
hr(size=1) |
||||
for thread in threads |
||||
.thread |
||||
+post(thread, true) |
||||
for post in thread.replies |
||||
+post(post, true) |
||||
hr(size=1) |
Loading…
Reference in new issue