bans now shown in table format, better in future if public ban list needed

merge-requests/208/head
fatchan 5 years ago
parent e4713c8e32
commit 830d0cc40e
  1. 2
      controllers/forms/removebans.js
  2. 15
      gulp/res/css/style.css
  3. 13
      views/includes/bantable.pug
  4. 53
      views/mixins/ban.pug
  5. 2
      views/mixins/managenav.pug
  6. 2
      views/mixins/post.pug
  7. 39
      views/pages/ban.pug
  8. 8
      views/pages/globalmanage.pug
  9. 7
      views/pages/managebans.pug
  10. 76
      views/pages/managesettings.pug

@ -11,7 +11,7 @@ module.exports = async (req, res, next) => {
errors.push('Must select 1-10 bans')
}
const redirect = req.params.board ? `/${req.params.board}/manage.html` : '/globalmanage.html';
const redirect = req.params.board ? `/${req.params.board}/manage/bans.html` : '/globalmanage.html';
if (errors.length > 0) {
return res.status(400).render('message', {

@ -210,6 +210,19 @@ p {
background: black!important; /*for detected coloring*/
}
.banposts .thread {
display: none;
text-align: left;
}
.banposts:hover .thread {
display: block;
position: fixed;
z-index: 1;
left:0;
right:0;
}
.banmessage {
color: red;
font-weight: bold;
@ -500,7 +513,7 @@ textarea {
text-align: left;
}
.post-container, .ban {
.post-container {
box-sizing: border-box;
padding: .5em;
max-width: 100%;

@ -0,0 +1,13 @@
.table-container.flex-center.mv-10.text-center
table(style='width:100%;')
tr
th
th Board
th Reason
th IP
th Issuer
th Issue Date
th Expiry
th Post(s)
th Appealable?
th Appeal

@ -1,27 +1,34 @@
include ./post.pug
mixin ban(ban, banpage)
.ban
if !banpage || (ban.appeal == null && ban.allowAppeal === true)
input.post-check(type='checkbox', name='checkedbans[]' value=ban._id)
span
| Banned
tr
td
if !banpage || (ban.appeal == null && ban.allowAppeal === true)
input.post-check(type='checkbox', name='checkedbans[]' value=ban._id)
td
if ban.board
| from #[a(href=`/${ban.board}/`) /#{ban.board}/]
a(href=`/${ban.board}/`) /#{ban.board}/
else
| globally
| for: #{ban.reason}
div Issued by: #{ban.issuer}
div Issued against: ...#{ban.ip.slice(-10)}
div Banned: #{ban.date.toLocaleString(undefined, {hour12:false})}
div Expires: #{ban.expireAt.toLocaleString()}
if ban.posts && ban.posts.length > 0
span Banned for the following post#{ban.posts.length > 1 ? 's' : ''}:
section.thread
each p in ban.posts
+post(p, false, false, false, true)
if ban.appeal != null
div Submitted appeal:
textarea(disabled='true') #{ban.appeal}
if !ban.allowAppeal
div This ban was issued as non-appealable.
| Global
td= ban.reason
td ...#{ban.ip.slice(-10)}
td= ban.issuer
td= ban.date.toLocaleString(undefined, {hour12:false})
td= ban.expireAt.toLocaleString()
td.banposts
if ban.posts && ban.posts.length > 0
| Hover to view
section.thread
each p in ban.posts
+post(p, false, false, false, true)
else
Posts not shown
td
if ban.allowAppeal
| ✓
else
| ⨯
td
if ban.appeal
textarea(rows=1 disabled='true') #{ban.appeal}
else if ban.allowAppeal
| No appeal submitted

@ -1,4 +1,4 @@
mixin managenav(selectedDL)
mixin managenav(selected)
nav.pages
a(href=`/${board._id}/manage/reports.html` class=(selected === 'reports' ? 'bold' : '')) [Reports]
|

@ -1,7 +1,7 @@
include ./report.pug
mixin post(post, truncate, manage=false, globalmanage=false, ban=false)
.anchor(id=post.postId)
article(class=`post-container ${post.thread ? '' : 'op'}`)
article(class=`post-container ${post.thread || ban === true ? '' : 'op'}`)
- const postURL = `/${post.board}/thread/${post.thread || post.postId}.html`;
header.post-info
label

@ -8,27 +8,20 @@ block head
block content
h1.board-title Banned!
h4.board-description Bans currently in place against your IP:
form.form-post(action=`/forms/appeal`, enctype='application/x-www-form-urlencoded', method='POST')
.table-container.flex-center.mv-10
table
tr
th Bans currently in place against your IP:
if bans.length > 0
for ban in bans
tr
td
+ban(ban, true)
if allowAppeal === true
tr
td
h4.no-m-p Appeal bans:
section.form-wrapper.flexleft.mt-10
input(type='hidden' name='_csrf' value=csrf)
section.row
.label Message
textarea(name='message' required)
section.row
.label Captcha
span.col
include ../includes/captcha.pug
input(type='submit', value='submit')
include ../includes/bantable.pug
for ban in bans
+ban(ban, true)
if allowAppeal === true
h4.no-m-p Appeal bans:
section.form-wrapper.flexleft.mt-10
input(type='hidden' name='_csrf' value=csrf)
section.row
.label Message
textarea(rows=1 name='message' required)
section.row
.label Captcha
span.col
include ../includes/captcha.pug
input(type='submit', value='submit')

@ -87,11 +87,9 @@ block content
input(type='hidden' name='_csrf' value=csrf)
if bans.length === 0
p No bans.
hr(size=1)
else
for ban in bans
section.thread
include ../includes/bantable.pug
for ban in bans
+ban(ban)
hr(size=1)
section.action-wrapper
input(type='submit', value='unban')
input(type='submit', value='unban')

@ -20,10 +20,9 @@ block content
if bans.length === 0
p No bans.
else
for ban in bans
section.thread
include ../includes/bantable.pug
for ban in bans
+ban(ban)
hr(size=1)
section.action-wrapper
input(type='submit', value='unban')
input(type='submit', value='unban')

@ -17,7 +17,7 @@ block content
section.form-wrapper.flexleft.mt-10
form.form-post(action=`/forms/board/${board._id}/transfer`, enctype='application/x-www-form-urlencoded', method='POST')
input(type='hidden' name='_csrf' value=csrf)
section.row
.row
.label New owner username
input(type='text' name='username' placeholder=board.owner required)
input(type='submit', value='submit')
@ -26,11 +26,11 @@ block content
section.form-wrapper.flexleft.mt-10
form.form-post(action=`/forms/board/${board._id}/deleteboard`, enctype='application/x-www-form-urlencoded', method='POST')
input(type='hidden' name='_csrf' value=csrf)
section.row
.row
.label I'm sure
label.postform-style.ph-5
input(type='checkbox', name='confirm', value='true' required)
section.row
.row
.label Board URI
input(type='text' name='uri' required)
input(type='submit', value='submit')
@ -39,138 +39,138 @@ block content
section.form-wrapper.flexleft.mt-10
form.form-post(action=`/forms/board/${board._id}/settings` method='POST' enctype='application/x-www-form-urlencoded')
input(type='hidden' name='_csrf' value=csrf)
section.row
.row
.label Board name
input(type='text' name='name' value=board.settings.name)
section.row
.row
.label Board Description
input(type='text' name='description' value=board.settings.description)
section.row
.row
.label Tags
textarea(name='tags' placeholder='newline separated, max 10') #{board.settings.tags.join('\n')}
section.row
.row
.label Announcement
textarea(name='announcement' placeholder='supports post styling') #{board.settings.announcement.raw}
section.row
.row
.label Anon Name
input(type='text' name='default_name' value=board.settings.defaultName)
section.row
.row
.label Max Files
input(type='number' name='max_files' value=board.settings.maxFiles max=globalLimits.postFiles.max)
section.row
.row
.label Allow Video Files
label.postform-style.ph-5
input(type='checkbox', name='files_allow_video', value='true' checked=board.settings.allowedFileTypes.video)
section.row
.row
.label Allow Image Files
label.postform-style.ph-5
input(type='checkbox', name='files_allow_image', value='true' checked=board.settings.allowedFileTypes.image)
section.row
.row
.label Allow Animated Image Files
label.postform-style.ph-5
input(type='checkbox', name='files_allow_animated_image', value='true' checked=board.settings.allowedFileTypes.animatedImage)
section.row
.row
.label Early 404
label.postform-style.ph-5
input(type='checkbox', name='early404', value='true' checked=board.settings.early404)
section.row
.row
.label IDs
label.postform-style.ph-5
input(type='checkbox', name='ids', value='true' checked=board.settings.ids)
section.row
.row
.label Geo Flags
label.postform-style.ph-5
input(type='checkbox', name='flags', value='true' checked=board.settings.flags)
section.row
.row
.label User Post Deletion
label.postform-style.ph-5
input(type='checkbox', name='user_post_delete', value='true' checked=board.settings.userPostDelete)
section.row
.row
.label User File Spoilering
label.postform-style.ph-5
input(type='checkbox', name='user_post_spoiler', value='true' checked=board.settings.userPostSpoiler)
section.row
.row
.label User File Unlinking
label.postform-style.ph-5
input(type='checkbox', name='user_post_unlink', value='true' checked=board.settings.userPostUnlink)
section.row
.row
.label Force Anon
label.postform-style.ph-5
input(type='checkbox', name='force_anon', value='true' checked=board.settings.forceAnon)
section.row
.row
.label Force Thread Subject
label.postform-style.ph-5
input(type='checkbox', name='force_thread_subject', value='true' checked=board.settings.forceThreadSubject)
section.row
.row
.label Force Thread Message
label.postform-style.ph-5
input(type='checkbox', name='force_thread_message', value='true' checked=board.settings.forceThreadMessage)
section.row
.row
.label Force Thread File
label.postform-style.ph-5
input(type='checkbox', name='force_thread_file', value='true' checked=board.settings.forceThreadFile)
section.row
.row
.label Force Reply Message
label.postform-style.ph-5
input(type='checkbox', name='force_reply_message', value='true' checked=board.settings.forceReplyMessage)
section.row
.row
.label Force Reply File
label.postform-style.ph-5
input(type='checkbox', name='force_reply_file', value='true' checked=board.settings.forceReplyFile)
section.row
.row
.label Min Thread Message Length
input(type='number' name='min_thread_message_length' value=board.settings.minThreadMessageLength max=globalLimits.messageLength.max)
section.row
.row
.label Min Reply Message Length
input(type='number' name='min_reply_message_length' value=board.settings.minReplyMessageLength max=globalLimits.messageLength.max)
section.row
.row
.label Thread Limit
input(type='number' name='thread_limit' value=board.settings.threadLimit min=globalLimits.threadLimit.min max=globalLimits.threadLimit.max)
section.row
.row
.label Reply Limit
input(type='number' name='reply_limit' value=board.settings.replyLimit min=globalLimits.replyLimit.min max=globalLimits.replyLimit.max)
section.row
.row
.label Moderators
textarea(name='moderators' placeholder='newline separated, max 10') #{board.settings.moderators.join('\n')}
section.row
.row
.label Board Locked
label.postform-style.ph-5
input(type='checkbox', name='locked', value='true' checked=board.settings.locked)
section.row
.row
.label Unlisted
label.postform-style.ph-5
input(type='checkbox', name='unlisted', value='true' checked=board.settings.unlisted)
section.row
.row
.label Theme
select(name='theme')
each theme in themes
option(value=theme selected=board.settings.theme === theme) #{theme}
section.row
.row
.label Captcha Mode
select(name='captcha_mode')
option(value='0', selected=board.settings.captchaMode === 0) No Captcha
option(value='1', selected=board.settings.captchaMode === 1) Captcha for new thread
option(value='2', selected=board.settings.captchaMode === 2) Captcha for all posts
section.row
.row
.label TPH Trigger Threshold
input(type='number', name='tph_trigger', value=board.settings.tphTrigger)
section.row
.row
.label TPH Trigger Action
select(name='tph_trigger_action')
option(value='0', selected=board.settings.tphTriggerAction === 0) Do nothing
option(value='1', selected=board.settings.tphTriggerAction === 1) Enable captcha for new thread
option(value='2', selected=board.settings.tphTriggerAction === 2) Enable captcha for all posts
option(value='3', selected=board.settings.tphTriggerAction === 3) Lock Board
section.row
.row
.label Filters
textarea(name='filters' placeholder='newline separated, max 50') #{board.settings.filters.join('\n')}
section.row
.row
.label Filter Mode
select(name='filter_mode')
option(value='0', selected=board.settings.filterMode === 0) Do nothing
option(value='1', selected=board.settings.filterMode === 1) Block post
option(value='2', selected=board.settings.filterMode === 2) Auto ban
section.row
.row
.label Filter Auto Ban Duration
input(type='text' name='ban_duration' placeholder='e.g. 1w' value=board.settings.filterBanDuration)
input(type='submit', value='save settings')

Loading…
Cancel
Save