indent and style fixes

merge-requests/208/head
fatchan 5 years ago
parent 0373ba610c
commit de953fd8cf
  1. 4
      controllers/forms.js
  2. 9
      gulp/res/css/style.css
  3. 16
      helpers/checks/spamcheck.js
  4. 1
      models/forms/makepost.js

@ -250,8 +250,8 @@ router.post('/board/:board/post', Boards.exists, banCheck, postFiles, paramConve
if (flood) { if (flood) {
deleteTempFiles(req).catch(e => console.error); deleteTempFiles(req).catch(e => console.error);
return res.status(429).render('message', { return res.status(429).render('message', {
'title': 'Too many requests', 'title': 'Flood detected',
'message': 'Flood detected', 'message': 'Please wait before making another post, or a post similar to another user',
'redirect': `/${req.params.board}${req.body.thread ? '/thread/' + req.body.thread + '.html' : ''}` 'redirect': `/${req.params.board}${req.body.thread ? '/thread/' + req.body.thread + '.html' : ''}`
}); });
} }

@ -110,11 +110,6 @@ object {
align-items: center; align-items: center;
} }
.navbar {
border-bottom: 1px solid #a9a9a9;
background: #d6daf0;
}
.catalog-tile { .catalog-tile {
padding: 5px; padding: 5px;
margin: 2px; margin: 2px;
@ -450,7 +445,7 @@ textarea {
.post-container.op { .post-container.op {
background: none; background: none;
border: none; border-color: transparent;
width: 100%; width: 100%;
} }
@ -520,8 +515,6 @@ textarea {
flex-shrink: 0; flex-shrink: 0;
margin-top: auto; margin-top: auto;
line-height: 30px; line-height: 30px;
border-top: 1px solid #a9a9a9;
background: #d6daf0;
} }
input[type="text"], input[type="submit"], input[type="password"], input[type="file"], textarea { input[type="text"], input[type="submit"], input[type="password"], input[type="file"], textarea {

@ -20,14 +20,14 @@ module.exports = async (req, res) => {
const contentOr = []; const contentOr = [];
if (res.locals.numFiles > 0) { if (res.locals.numFiles > 0) {
contentOr.push({ contentOr.push({
'files': { 'files': {
'$elemMatch': { '$elemMatch': {
'hash': { //any file hash will match, doesnt need to be all 'hash': { //any file hash will match, doesnt need to be all
'$in': req.files.file.map(f => f.sha256) '$in': req.files.file.map(f => f.sha256)
} }
} }
} }
}); });
} }
if (req.body.message) { if (req.body.message) {
contentOr.push({ contentOr.push({
@ -58,8 +58,8 @@ module.exports = async (req, res) => {
}) })
let flood = await Posts.db.find({ let flood = await Posts.db.find({
'$or': ors '$or': ors
}).toArray(); }).toArray();
return flood.length > 0; return flood.length > 0;

@ -304,6 +304,7 @@ console.log(`NEW POST -> ${successRedirect}`);
} else { } else {
//new thread, prunes any old threads before rebuilds //new thread, prunes any old threads before rebuilds
const prunedThreads = await Posts.pruneOldThreads(req.params.board, res.locals.board.settings.threadLimit); const prunedThreads = await Posts.pruneOldThreads(req.params.board, res.locals.board.settings.threadLimit);
//TODO: could add early404 here alongside thread pruning.
if (prunedThreads.length > 0) { if (prunedThreads.length > 0) {
await deletePosts(prunedThreads, req.params.board); await deletePosts(prunedThreads, req.params.board);
} }

Loading…
Cancel
Save