Files

98 lines
4.6 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
include ../mixins/filelabel.pug
- const isThread = thread != null;
- const subjectRequired = (!isThread && board.settings.forceThreadSubject);
- const messageRequired = (!isThread && board.settings.forceThreadMessage) || (isThread && board.settings.forceReplyMessage);
- const fileRequired = (!isThread && board.settings.forceThreadFile) || (isThread && board.settings.forceReplyFile);
section.form-wrapper.flex-center
form.form-post#postform(action=`/forms/board/${board._id}/${modview ? 'mod' : ''}post`, enctype='multipart/form-data', method='POST' data-reset-on-submit='true')
if modview
input(type='hidden' name='_csrf' value=csrf)
input(type='hidden' name='thread' value=isThread ? thread.postId : null)
section.row.jsonly
.noselect#postform-dragHandle #{isThread ? __('New Reply') : __('New Thread')}
if board.settings.forceAnon && !modview
section.row
.label Sage
label.postform-style.ph-5
input(type='checkbox', name='email', value='sage')
a.close.postform-style(href='#!') ×
include ./subjectfield.pug
else
section.row
.label #{__('Name')}
input.mr-1(type='text', name='name', placeholder=board.settings.defaultName maxlength=globalLimits.fieldLength.name)
a.close.postform-style(href='#!') ×
if board.settings.sageOnlyEmail && !modview
section.row
.label #{__('Sage')}
label.postform-style.ph-5
input(type='checkbox', name='email', value='sage')
else
section.row
.label #{__('Email')}
input(type='text', name='email', autocomplete='off' maxlength=globalLimits.fieldLength.email)
include ./subjectfield.pug
section.row
.label
span #{__('Message')}
if messageRequired
span.required *
- const minLength = (isThread ? board.settings.minReplyMessageLength : board.settings.minThreadMessageLength) || 0;
- const maxLength = Math.min((isThread ? board.settings.maxReplyMessageLength : board.settings.maxThreadMessageLength), globalLimits.fieldLength.message) || globalLimits.fieldLength.message;
textarea#message(name='message', rows='5', minlength=minLength maxlength=maxLength required=messageRequired)
if board.settings.maxFiles > 0 && Object.values(board.settings.allowedFileTypes).some(x => x === true)
- const maxFiles = board.settings.maxFiles;
section.row
.label
span #{__n('Files', maxFiles)}
if fileRequired
span.required *
|
|
if maxFiles > 1
small #{__n('Max %s files', maxFiles)}
small #{postFilesSize} #{__('total')}
span.col
+filelabel('file', maxFiles)
input#file(type='file', name='file' multiple required=fileRequired )
.upload-list(data-spoilers=(board.settings.userPostSpoiler ? 'true' : 'false') data-strip-filenames='true')
if board.settings.userPostSpoiler
noscript
label.noselect.postform-style.ph-5.ml-1.fh
input(type='checkbox', name='spoiler_all', value='true')
| Spoiler
if board.settings.enableTegaki && board.settings.allowedFileTypes.image === true
section.row.jsonly
.label #{__('Tegaki')}
input.dummy-link.tegaki-button(type='button', value=__('Draw'))
if board.settings.allowedFileTypes.other === true
label.noselect.postform-style.ph-5.ml-1.fh
input(type='checkbox' name='tegakireplay')
| #{__('Replayable?')}
if board.settings.userPostSpoiler || board.settings.userPostDelete || board.settings.userPostUnlink || modview
section.row
.label Password
input(type='password', name='postpassword', placeholder='Password to delete/spoiler/unlink later' maxlength='50' autocomplete='new-password')
if modview || board.settings.customFlags === true
- const boardFlags = Object.entries(board.flags)
if boardFlags.length > 0
section.row
.label #{__('Flag')}
select#customflag(name='customflag')
option(value='') #{board.settings.geoFlags === true ? __('Geographic Flag') : __('None')}
each flag in boardFlags
option(value=flag[0] data-src=`/flag/${board._id}/${flag[1]}`) #{flag[0]}
img.jsonly#selected-flag
if enableWeb3 === true && board.settings.enableWeb3 === true
section.row.jsonly.web3
.label #{__('Web3')}
input.dummy-link.web3-sign(type='button' value=__('Sign') disabled=true)
textarea.ml-1.no-resize(name='signature', rows='1', autocomplete='off' readonly)
if ((board.settings.captchaMode === 1 && !isThread) || board.settings.captchaMode === 2) && !modview
if captchaOptions.type === 'text'
include ./captchasidelabel.pug
else
include ./captchaexpand.pug
input#submitpost(type='submit', value=(isThread ? __('New Reply') : __('New Thread')))
a.collapse.no-decoration.post-button(href='#postform') [#{isThread ? __('New Reply') : __('New Thread')}]