diff --git a/public/index.css b/public/index.css index d48d55e..3acd284 100644 --- a/public/index.css +++ b/public/index.css @@ -35,8 +35,8 @@ body { .header-big { width: 800px; - margin: -10px; - padding: 10px; + margin: -5px; + padding: 5px; background: var(--main-5); border-top-left-radius: 10px; border-top-right-radius: 10px; @@ -114,7 +114,7 @@ body { .nav, .main { border: solid var(--main-1) 5px; - padding: 10px; + padding: 5px; width: 800px; max-width: calc(100vw - 40px); } @@ -182,4 +182,12 @@ form .header-big, background: var(--main-3); color: var(--main-1); margin: .5rem; +} + +.sub { + font-size: 0.8em; +} + +h1 { + font-size: 1.4em; } \ No newline at end of file diff --git a/routes/comment.js b/routes/comment.js index 0222798..967511e 100644 --- a/routes/comment.js +++ b/routes/comment.js @@ -35,8 +35,6 @@ router.get('/:id', async (req, res, next) => { replies = replies.filter(x => x.comment != 'fail'); - console.log(replies) - res.ctx.mainPage = 'commenter' res.ctx.mainCtx = { replies diff --git a/routes/walls.js b/routes/walls.js index 70d070d..0284bc6 100644 --- a/routes/walls.js +++ b/routes/walls.js @@ -37,6 +37,11 @@ router.get('/get/:type/:id/:num', async (req, res, next) => { req.params.num * 10 ]); + replies.splice(0, 0, { + childType: 'comment', + childId: req.params.id + }) + for (let reply of replies) { let dat = await db.all('SELECT * FROM comment WHERE id = ?', [ reply.childId @@ -50,6 +55,7 @@ router.get('/get/:type/:id/:num', async (req, res, next) => { reply.comment.id = reply.childId; } + let comment = replies.splice(0, 1)[0]; replies = replies.filter(x => x.comment != 'fail'); res.ctx.mainPage = 'replies' @@ -59,7 +65,9 @@ router.get('/get/:type/:id/:num', async (req, res, next) => { opLink: `/${req.params.type}/${req.params.id}`, type: req.params.type, - id: req.params.id + id: req.params.id, + + comment } next(); }) diff --git a/views/comment.ejs b/views/comment.ejs index c1bb3f2..4fecc84 100644 --- a/views/comment.ejs +++ b/views/comment.ejs @@ -1,8 +1,7 @@