Showing
2 changed files
with
18 additions
and
2 deletions
... | @@ -9,8 +9,8 @@ app.get('/board/:bid', async(req, res) => { | ... | @@ -9,8 +9,8 @@ app.get('/board/:bid', async(req, res) => { |
9 | if(!board) { | 9 | if(!board) { |
10 | res.status(404).json({error: 'Board not found'}); | 10 | res.status(404).json({error: 'Board not found'}); |
11 | } | 11 | } |
12 | - let threads = await db.get('thread').find({board: board._id}, {sort: '-lastUpdated', limit: 20}); | 12 | + let threads = await db.get('thread').find({board: board._id}, {sort: '-lastUpdated', limit: 50}); |
13 | - res.json({threads: threads}) | 13 | + res.render('threadslist', {board, threads}); |
14 | }); | 14 | }); |
15 | 15 | ||
16 | app.post('/board/:bid/thread', async(req, res) => { | 16 | app.post('/board/:bid/thread', async(req, res) => { | ... | ... |
src/views/threadslist.handlebars
0 → 100644
1 | +<h1> | ||
2 | + {{board.title}} | ||
3 | + <small class="text-muted"> | ||
4 | + {{board.name}} | ||
5 | + </small> | ||
6 | +</h1> | ||
7 | +<table class="table"> | ||
8 | + {{#each threads}} | ||
9 | + <tr> | ||
10 | + <td> | ||
11 | + {{this.title}} | ||
12 | + ({{this.count}}) | ||
13 | + </td> | ||
14 | + </tr> | ||
15 | + {{/each}} | ||
16 | +</table> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment