|
|
@ -63,43 +63,44 @@ mixin post(post, truncate, manage=false, globalmanage=false, ban=false) |
|
|
|
img.file-thumb(src=`/img/thumb-${file.hash}.jpg` height=file.geometry.thumbheight width=file.geometry.thumbwidth) |
|
|
|
img.file-thumb(src=`/img/thumb-${file.hash}.jpg` height=file.geometry.thumbheight width=file.geometry.thumbwidth) |
|
|
|
else |
|
|
|
else |
|
|
|
img.file-thumb(src=`/img/${file.filename}` height=file.geometry.height width=file.geometry.width) |
|
|
|
img.file-thumb(src=`/img/${file.filename}` height=file.geometry.height width=file.geometry.width) |
|
|
|
|
|
|
|
- let truncatedMessage = post.message; |
|
|
|
if post.message |
|
|
|
if post.message |
|
|
|
if truncate |
|
|
|
if truncate |
|
|
|
- |
|
|
|
- |
|
|
|
const splitPost = post.message.split('\n'); |
|
|
|
const splitPost = post.message.split('\n'); |
|
|
|
const messageLines = splitPost.length; |
|
|
|
const messageLines = splitPost.length; |
|
|
|
let truncatedMessage = post.message; |
|
|
|
|
|
|
|
if (messageLines > 10) { |
|
|
|
if (messageLines > 10) { |
|
|
|
truncatedMessage = splitPost.slice(0, 10).join('\n'); |
|
|
|
truncatedMessage = splitPost.slice(0, 10).join('\n'); |
|
|
|
} else if (post.message.length > 1000) { |
|
|
|
} else if (post.message.length > 1000) { |
|
|
|
truncatedMessage = post.message.substring(0,1000).replace(/<([\w]+)?([^>]*)?$/, ''); |
|
|
|
truncatedMessage = post.message.substring(0,1000).replace(/<([\w]+)?([^>]*)?$/, ''); |
|
|
|
} |
|
|
|
} |
|
|
|
pre.post-message !{truncatedMessage} |
|
|
|
pre.post-message !{truncatedMessage} |
|
|
|
if truncatedMessage !== post.message |
|
|
|
|
|
|
|
p Message too long. #[a(href=`${postURL}#${post.postId}`) View the full text] |
|
|
|
|
|
|
|
else |
|
|
|
else |
|
|
|
pre.post-message !{post.message} |
|
|
|
pre.post-message !{post.message} |
|
|
|
if !post.message && post.files.length === 0 |
|
|
|
if !post.message && post.files.length === 0 |
|
|
|
p Post files unlinked |
|
|
|
p Post files unlinked |
|
|
|
if post.banmessage |
|
|
|
if post.banmessage |
|
|
|
p.banmessage USER BANNED FOR THIS POST #{post.banmessage ? `(${post.banmessage})` : ''} |
|
|
|
p.banmessage USER WAS BANNED FOR THIS POST #{post.banmessage ? `(${post.banmessage})` : ''} |
|
|
|
|
|
|
|
if truncatedMessage !== post.message |
|
|
|
|
|
|
|
div.cb.mt-5.ml-5 |
|
|
|
|
|
|
|
| Message too long. #[a(href=`${postURL}#${post.postId}`) View the full text] |
|
|
|
if post.omittedposts || post.omittedfiles |
|
|
|
if post.omittedposts || post.omittedfiles |
|
|
|
p |
|
|
|
div.cb.mt-5.ml-5 |
|
|
|
- const ompo = post.omittedposts; |
|
|
|
- const ompo = post.omittedposts; |
|
|
|
- const omfi = post.omittedfiles; |
|
|
|
- const omfi = post.omittedfiles; |
|
|
|
| #{ompo} post#{ompo > 1 ? 's' : ''} |
|
|
|
| #{ompo} repl#{ompo > 1 ? 'ies' : 'y'} |
|
|
|
| #{omfi > 0 ? ` and ${omfi} image${omfi > 1 ? 's' : ''}` : ''} omitted. |
|
|
|
| #{omfi > 0 ? ` and ${omfi} image${omfi > 1 ? 's' : ''}` : ''} omitted. |
|
|
|
| #[a(href=`${postURL}#${post.postId}`) View the full thread] |
|
|
|
| #[a(href=`${postURL}#${post.postId}`) View the full thread] |
|
|
|
if post.previewbacklinks && post.previewbacklinks.length > 0 |
|
|
|
if post.previewbacklinks && post.previewbacklinks.length > 0 |
|
|
|
.replies Replies: |
|
|
|
div.replies.mt-5.ml-5 Replies: |
|
|
|
each backlink in post.previewbacklinks |
|
|
|
each backlink in post.previewbacklinks |
|
|
|
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink.postId}`) >>#{backlink.postId} |
|
|
|
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink.postId}`) >>#{backlink.postId} |
|
|
|
| |
|
|
|
| |
|
|
|
if post.previewbacklinks.length < post.backlinks.length |
|
|
|
if post.previewbacklinks.length < post.backlinks.length |
|
|
|
- const ombls = post.backlinks.length-post.previewbacklinks.length; |
|
|
|
- const ombls = post.backlinks.length-post.previewbacklinks.length; |
|
|
|
| + #{ombls} reply link#{ombls > 1 ? 's' : ''} omitted |
|
|
|
| + #[a(href=`${postURL}#${post.postId}`) #{ombls} earlier] |
|
|
|
else if post.backlinks && post.backlinks.length > 0 |
|
|
|
else if post.backlinks && post.backlinks.length > 0 |
|
|
|
.replies Replies: |
|
|
|
div.replies.mt-5.ml-5 Replies: |
|
|
|
each backlink in post.backlinks |
|
|
|
each backlink in post.backlinks |
|
|
|
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink.postId}`) >>#{backlink.postId} |
|
|
|
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink.postId}`) >>#{backlink.postId} |
|
|
|
| |
|
|
|
| |
|
|
|