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.
 
 
 
 
 

52 lines
1.9 KiB

mixin post(post, truncate, showreports)
article(id=post.postId class='post-container '+(post.thread ? '' : 'op'))
header.post-info
span
input.post-check(type='checkbox', name='checkedposts[]' value=post.postId)
if post.subject
span.post-subject #{post.subject}
if post.email
a(href=`mailto:${post.email}`)
span.post-name #{post.name}
else
span.post-name #{post.name}
span #{post.date.toLocaleString()}
span.user-id(style=`background: #${post.userId}`) #{post.userId}
span: a(href=`/${post.board}/thread/${post.thread || post.postId}#${post.postId}`) ##{post.postId}
if post.files.length > 0
.post-files
each file in post.files
.post-file
small.post-file-info
span: a(href='/img/'+file.filename download=file.originalFilename) #{file.originalFilename}
br
span (#{file.sizeString} #{file.geometryString})
.post-file-src
a(target='_blank' href='/img/'+file.filename)
if post.spoiler
object(data='/img/spoiler.png' width='128' height='128')
else
object(data=`/img/thumb-${file.filename.split('.')[0]}.png` width='128' height='128')
if post.message
if truncate
-
const splitPost = post.message.split('\n');
const messageLines = splitPost.length;
let truncatedMessage = post.mesage;
let truncated = false;
if (messageLines > 10 || post.message.length > 1000) {
truncatedMessage = splitPost.slice(0, 16).join('\n');
truncated = true;
}
if truncated
blockquote.post-message !{truncatedMessage}
p Message too long. #[a(href=`/${post.board}/thread/${post.thread || post.postId}#${post.postId}`) Click here] to view the full text.
else
blockquote.post-message !{post.message}
else
blockquote.post-message !{post.message}
if showreports && post.reports
each report in post.reports
.reports.post-container
span Date: #{report.date.toLocaleString()}
span Reason: #{report.reason}