|
|
|
mixin post(post, truncate, manage=false, globalmanage=false)
|
|
|
|
article(id=post.postId class='post-container '+(post.thread ? '' : 'op'))
|
|
|
|
- const postURL = `/${post.board}/thread/${post.thread || post.postId}#${post.postId}`;
|
|
|
|
header.post-info
|
|
|
|
if globalmanage
|
|
|
|
input.post-check(type='checkbox', name='globalcheckedposts[]' value=post._id)
|
|
|
|
else
|
|
|
|
input.post-check(type='checkbox', name='checkedposts[]' value=post.postId)
|
|
|
|
|
|
|
|
|
if !post.thread
|
|
|
|
if post.sticky
|
|
|
|
img(src='/img/sticky.svg' height='12')
|
|
|
|
if post.saged
|
|
|
|
img(src='/img/saged.svg' height='12')
|
|
|
|
if post.locked
|
|
|
|
img(src='/img/locked.svg' height='12')
|
|
|
|
|
|
|
|
|
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}
|
|
|
|
|
|
|
|
|
if post.tripcode
|
|
|
|
span.post-tripcode #{post.tripcode}
|
|
|
|
|
|
|
|
|
if post.capcode
|
|
|
|
span.post-capcode #{post.capcode}
|
|
|
|
|
|
|
|
|
span #{post.date.toLocaleString()}
|
|
|
|
|
|
|
|
|
span.user-id(style=`background: #${post.userId}`) #{post.userId}
|
|
|
|
|
|
|
|
|
span: a(href=postURL) No.#{post.postId}
|
|
|
|
.post-data
|
|
|
|
if post.files.length > 0
|
|
|
|
.post-files
|
|
|
|
each file in post.files
|
|
|
|
.post-file
|
|
|
|
small.post-file-info
|
|
|
|
span: a(href='/img/'+file.filename title=file.originalFilename download=file.originalFilename) #{file.originalFilename}
|
|
|
|
br
|
|
|
|
span
|
|
|
|
| (#{file.sizeString}, #{file.geometryString}
|
|
|
|
if file.durationString
|
|
|
|
| , #{file.durationString}
|
|
|
|
| )
|
|
|
|
.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]}.jpg`)
|
|
|
|
if post.message
|
|
|
|
if truncate
|
|
|
|
-
|
|
|
|
const splitPost = post.message.split('\n');
|
|
|
|
const messageLines = splitPost.length;
|
|
|
|
let truncatedMessage = post.message;
|
|
|
|
let truncated = false;
|
|
|
|
if (messageLines > 10 || post.message.length > 1000) {
|
|
|
|
truncatedMessage = splitPost.slice(0, 10).join('\n');
|
|
|
|
truncated = true;
|
|
|
|
}
|
|
|
|
blockquote.post-message !{truncatedMessage}
|
|
|
|
if truncated
|
|
|
|
blockquote.left.clear-both Message too long. #[a(href=postURL) View the full text]
|
|
|
|
else
|
|
|
|
blockquote.post-message !{post.message}
|
|
|
|
if post.banmessage
|
|
|
|
blockquote.left.clear-both.banmessage USER WAS BANNED FOR THIS POST (#{post.banmessage})
|
|
|
|
if post.omittedposts || post.omittedimages
|
|
|
|
blockquote.left.clear-both #{post.omittedposts} post(s)#{post.omittedimages > 0 ? ' and '+post.omittedimages+' image(s)' : ''} omitted. #[a(href=postURL) View the full thread]
|
|
|
|
|
|
|
|
if manage === true
|
|
|
|
each report in post.reports
|
|
|
|
.reports.post-container
|
|
|
|
span Date: #{report.date.toLocaleString()}
|
|
|
|
|
|
|
|
|
span Reason: #{report.reason}
|
|
|
|
if globalmanage === true
|
|
|
|
each report in post.globalreports
|
|
|
|
.reports.post-container
|
|
|
|
span Date: #{report.date.toLocaleString()}
|
|
|
|
|
|
|
|
|
span Reason: #{report.reason}
|