jschan - Anonymous imageboard software. Classic look, modern features and feel. Works without JavaScript and supports Tor, I2P, Lokinet, etc.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 lines
1.4 KiB

include ./filelabel.pug
mixin fileform(name, max, total, addPath, deletePath, checkName, fileList, nameList, filePath, imageClass, showName, showLink, formDescription)
- const capitalName = `${name.charAt(0).toUpperCase()}${name.substring(1)}`;
h4.no-m-p #{__n(`Add ${capitalName} (Max %s)`, total)}
p #{formDescription}
.form-wrapper.flexleft.mt-10
form.form-post(action=addPath, enctype='multipart/form-data', method='POST')
input(type='hidden' name='_csrf' value=csrf)
.row
.label
span #{__n(capitalName, max)}
span.required *
if max > 1
|
|
small (#{__n('Max %s', max)})
span.col
+filelabel(name, max)
input(id=name type='file', name='file' multiple required)
.upload-list(data-spoilers='false' data-strip-filenames='false')
input(type='submit', value=__('Submit'))
if fileList.length > 0
h4.mv-5 #{__(`Delete ${capitalName}s`)}:
.form-wrapper.flexleft.mt-10
form.form-post(action=deletePath, enctype='application/x-www-form-urlencoded', method='POST')
input(type='hidden' name='_csrf' value=csrf)
.catalog
each file, index in fileList
label.asset-check
input(type='checkbox' name=checkName value=nameList[index])
img(class=imageClass src=`${filePath}/${file}` loading='lazy')
if showName
small #{nameList[index]}
if showLink
a(href=`${filePath}/${file}`) Link
input(type='submit', value=__('Delete'))