mirror of https://gitgud.io/fatchan/jschan.git
merge-requests/208/head
parent
ff4f6c4758
commit
e80e9e4452
20 changed files with 130 additions and 82 deletions
@ -1,20 +1,24 @@ |
||||
'use strict'; |
||||
|
||||
const Posts = require(__dirname+'/../../db/posts.js'); |
||||
const Posts = require(__dirname+'/../../db/posts.js') |
||||
, Bans = require(__dirname+'/../../db/bans.js'); |
||||
|
||||
module.exports = async (req, res, next) => { |
||||
|
||||
let posts; |
||||
let reports; |
||||
let bans; |
||||
try { |
||||
posts = await Posts.getAllReports(); |
||||
reports = await Posts.getAllReports(); |
||||
bans = await Bans.getAllBans(); |
||||
} catch (err) { |
||||
return next(err); |
||||
return next(err) |
||||
} |
||||
|
||||
//render the page
|
||||
res.render('globalmanage', { |
||||
csrf: req.csrfToken(), |
||||
posts: posts |
||||
reports, |
||||
bans, |
||||
}); |
||||
|
||||
} |
||||
|
@ -1,25 +1,32 @@ |
||||
.action-wrapper Actions: |
||||
label |
||||
input.post-check(type='checkbox', name='delete' value=1) |
||||
| Delete Post |
||||
label |
||||
input.post-check(type='checkbox', name='spoiler' value=1) |
||||
| Spoiler Images |
||||
label |
||||
input#password(type='text', name='password', placeholder='post password' autocomplete='off') |
||||
.action-wrapper Mod Actions: |
||||
label |
||||
input.post-check(type='checkbox', name='dismiss' value=1) |
||||
| Dismiss Reports |
||||
label |
||||
input.post-check(type='checkbox', name='ban' value=1) |
||||
| Ban Poster |
||||
label |
||||
input.post-check(type='checkbox', name='global_ban' value=1) |
||||
| Global Ban Poster |
||||
label |
||||
input.post-check(type='checkbox', name='preserve_post' value=1) |
||||
| Show Post In Ban |
||||
label |
||||
input#report(type='text', name='reason', placeholder='ban reason' autocomplete='off') |
||||
input(type='submit', value='submit') |
||||
.action-wrapper |
||||
.actions Actions: |
||||
label |
||||
input.post-check(type='checkbox', name='delete' value=1) |
||||
| Delete Post |
||||
label |
||||
input.post-check(type='checkbox', name='spoiler' value=1) |
||||
| Spoiler Images |
||||
label |
||||
input#password(type='text', name='password', placeholder='post password' autocomplete='off') |
||||
label |
||||
input.post-check(type='checkbox', name='report' value=1) |
||||
| Report Post |
||||
label |
||||
input#report(type='text', name='report_reason', placeholder='report reason' autocomplete='off') |
||||
.actions Mod Actions: |
||||
label |
||||
input.post-check(type='checkbox', name='dismiss' value=1) |
||||
| Dismiss Reports |
||||
label |
||||
input.post-check(type='checkbox', name='ban' value=1) |
||||
| Ban Poster |
||||
label |
||||
input.post-check(type='checkbox', name='global_ban' value=1) |
||||
| Global Ban Poster |
||||
label |
||||
input.post-check(type='checkbox', name='preserve_post' value=1) |
||||
| Show Post In Ban |
||||
label |
||||
input#report(type='text', name='ban_reason', placeholder='ban reason' autocomplete='off') |
||||
input(type='submit', value='submit') |
||||
|
||||
|
@ -1,11 +1,35 @@ |
||||
extends ../layout.pug |
||||
include ../mixins/post.pug |
||||
include ../mixins/ban.pug |
||||
|
||||
block head |
||||
title Manage |
||||
|
||||
block content |
||||
h1.board-title Global Management |
||||
hr(size=1) |
||||
p under construction |
||||
|
||||
h4 All Reports: |
||||
form(action=`/forms/global/actions` method='POST' enctype='application/x-www-form-urlencoded') |
||||
input(type='hidden' name='_csrf' value=csrf) |
||||
if reports.length === 0 |
||||
p No reports. |
||||
hr(size=1) |
||||
else |
||||
for report in reports |
||||
section.thread |
||||
+post(report, false, true) |
||||
hr(size=1) |
||||
include ../includes/deletefooter.pug |
||||
hr(size=1) |
||||
h4 All Bans: |
||||
form(action=`/forms/global/unban` method='POST' enctype='application/x-www-form-urlencoded') |
||||
input(type='hidden' name='_csrf' value=csrf) |
||||
if bans.length === 0 |
||||
p No bans. |
||||
hr(size=1) |
||||
else |
||||
for ban in bans |
||||
section.thread |
||||
+ban(ban) |
||||
hr(size=1) |
||||
section.action-wrapper |
||||
input(type='submit', value='unban') |
||||
|
Loading…
Reference in new issue