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'; |
'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) => { |
module.exports = async (req, res, next) => { |
||||||
|
|
||||||
let posts; |
let reports; |
||||||
|
let bans; |
||||||
try { |
try { |
||||||
posts = await Posts.getAllReports(); |
reports = await Posts.getAllReports(); |
||||||
|
bans = await Bans.getAllBans(); |
||||||
} catch (err) { |
} catch (err) { |
||||||
return next(err); |
return next(err) |
||||||
} |
} |
||||||
|
|
||||||
//render the page
|
//render the page
|
||||||
res.render('globalmanage', { |
res.render('globalmanage', { |
||||||
csrf: req.csrfToken(), |
csrf: req.csrfToken(), |
||||||
posts: posts |
reports, |
||||||
|
bans, |
||||||
}); |
}); |
||||||
|
|
||||||
} |
} |
||||||
|
@ -1,25 +1,32 @@ |
|||||||
.action-wrapper Actions: |
.action-wrapper |
||||||
label |
.actions Actions: |
||||||
input.post-check(type='checkbox', name='delete' value=1) |
label |
||||||
| Delete Post |
input.post-check(type='checkbox', name='delete' value=1) |
||||||
label |
| Delete Post |
||||||
input.post-check(type='checkbox', name='spoiler' value=1) |
label |
||||||
| Spoiler Images |
input.post-check(type='checkbox', name='spoiler' value=1) |
||||||
label |
| Spoiler Images |
||||||
input#password(type='text', name='password', placeholder='post password' autocomplete='off') |
label |
||||||
.action-wrapper Mod Actions: |
input#password(type='text', name='password', placeholder='post password' autocomplete='off') |
||||||
label |
label |
||||||
input.post-check(type='checkbox', name='dismiss' value=1) |
input.post-check(type='checkbox', name='report' value=1) |
||||||
| Dismiss Reports |
| Report Post |
||||||
label |
label |
||||||
input.post-check(type='checkbox', name='ban' value=1) |
input#report(type='text', name='report_reason', placeholder='report reason' autocomplete='off') |
||||||
| Ban Poster |
.actions Mod Actions: |
||||||
label |
label |
||||||
input.post-check(type='checkbox', name='global_ban' value=1) |
input.post-check(type='checkbox', name='dismiss' value=1) |
||||||
| Global Ban Poster |
| Dismiss Reports |
||||||
label |
label |
||||||
input.post-check(type='checkbox', name='preserve_post' value=1) |
input.post-check(type='checkbox', name='ban' value=1) |
||||||
| Show Post In Ban |
| Ban Poster |
||||||
label |
label |
||||||
input#report(type='text', name='reason', placeholder='ban reason' autocomplete='off') |
input.post-check(type='checkbox', name='global_ban' value=1) |
||||||
input(type='submit', value='submit') |
| 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 |
extends ../layout.pug |
||||||
include ../mixins/post.pug |
include ../mixins/post.pug |
||||||
|
include ../mixins/ban.pug |
||||||
|
|
||||||
block head |
block head |
||||||
title Manage |
title Manage |
||||||
|
|
||||||
block content |
block content |
||||||
h1.board-title Global Management |
h1.board-title Global Management |
||||||
hr(size=1) |
h4 All Reports: |
||||||
p under construction |
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