mirror of https://gitgud.io/fatchan/jschan.git
parent
1ead7e26c3
commit
ab7086dd59
5 changed files with 115 additions and 118 deletions
@ -1,104 +1,104 @@ |
|||||||
mixin post(post, truncate, manage=false, globalmanage=false) |
mixin post(post, truncate, manage=false, globalmanage=false) |
||||||
.pad-anchor(id=post.postId) |
.anchor(id=post.postId) |
||||||
article(class='post-container '+(post.thread ? '' : 'op')) |
article(class='post-container '+(post.thread ? '' : 'op')) |
||||||
- const postURL = `/${post.board}/thread/${post.thread || post.postId}.html#${post.postId}`; |
- const postURL = `/${post.board}/thread/${post.thread || post.postId}.html#${post.postId}`; |
||||||
header.post-info |
header.post-info |
||||||
if globalmanage |
if globalmanage |
||||||
input.post-check(type='checkbox', name='globalcheckedposts[]' value=post._id) |
input.post-check(type='checkbox', name='globalcheckedposts[]' value=post._id) |
||||||
else |
else |
||||||
input.post-check(type='checkbox', name='checkedposts[]' value=post.postId) |
input.post-check(type='checkbox', name='checkedposts[]' value=post.postId) |
||||||
| |
| |
||||||
if !post.thread |
if !post.thread |
||||||
if post.sticky |
if post.sticky |
||||||
img(src='/img/sticky.svg' height='12' title='Stickied') |
img(src='/img/sticky.svg' height='12' title='Stickied') |
||||||
| |
|
||||||
if post.saged |
|
||||||
img(src='/img/saged.svg' height='12' title='Permasaged') |
|
||||||
| |
|
||||||
if post.locked |
|
||||||
img(src='/img/locked.svg' height='12' title='Locked') |
|
||||||
| |
|
||||||
if post.subject |
|
||||||
span.post-subject #{post.subject} |
|
||||||
| |
| |
||||||
if post.email |
if post.saged |
||||||
a(href=`mailto:${post.email}`) |
img(src='/img/saged.svg' height='12' title='Permasaged') |
||||||
span.post-name #{post.name} |
|
||||||
else |
|
||||||
span.post-name #{post.name} |
|
||||||
| |
|
||||||
if post.tripcode |
|
||||||
span.post-tripcode #{post.tripcode} |
|
||||||
| |
| |
||||||
if post.capcode |
if post.locked |
||||||
span.post-capcode #{post.capcode} |
img(src='/img/locked.svg' height='12' title='Locked') |
||||||
| |
| |
||||||
span #{post.date.toLocaleString()} |
if post.subject |
||||||
|
span.post-subject #{post.subject} |
||||||
| |
| |
||||||
if post.userId |
if post.email |
||||||
span.user-id(style=`background: #${post.userId}`) #{post.userId} |
a(href=`mailto:${post.email}`) |
||||||
| |
span.post-name #{post.name} |
||||||
span: a(href=postURL) No.#{post.postId} |
else |
||||||
if !post.thread |
span.post-name #{post.name} |
||||||
| |
| |
||||||
span: a(href=`/${post.board}/thread/${post.thread || post.postId}.html#postform`) [Reply] |
if post.tripcode |
||||||
.post-data |
span.post-tripcode #{post.tripcode} |
||||||
if post.files.length > 0 |
| |
||||||
.post-files |
if post.capcode |
||||||
each file in post.files |
span.post-capcode #{post.capcode} |
||||||
.post-file |
| |
||||||
span.post-file-info |
span #{post.date.toLocaleString()} |
||||||
span: a(href='/img/'+file.filename title='Download '+file.originalFilename download=file.originalFilename) #{post.spoiler ? 'Spoiler File' : file.originalFilename} |
| |
||||||
br |
if post.userId |
||||||
span |
span.user-id(style=`background: #${post.userId}`) #{post.userId} |
||||||
| (#{file.sizeString}, #{file.geometryString} |
| |
||||||
if file.durationString |
span: a(href=postURL) No.#{post.postId} |
||||||
| , #{file.durationString} |
if !post.thread |
||||||
| ) |
| |
||||||
.post-file-src |
span: a(href=`/${post.board}/thread/${post.thread || post.postId}.html#postform`) [Reply] |
||||||
a(target='_blank' href=`/img/${file.filename}`) |
.post-data |
||||||
if post.spoiler |
if post.files.length > 0 |
||||||
img.file-thumb(src='/img/spoiler.png' width='128' height='128') |
.post-files |
||||||
else if file.hasThumb |
each file in post.files |
||||||
object.file-thumb(data=`/img/thumb-${file.filename.split('.')[0]}.jpg`) |
.post-file |
||||||
img(src='/img/deleted.png') |
span.post-file-info |
||||||
else |
span: a(href='/img/'+file.filename title='Download '+file.originalFilename download=file.originalFilename) #{post.spoiler ? 'Spoiler File' : file.originalFilename} |
||||||
object.file-thumb(data=`/img/${file.filename}`) |
br |
||||||
img(src='/img/deleted.png') |
span |
||||||
if post.message |
| (#{file.sizeString}, #{file.geometryString} |
||||||
if truncate |
if file.durationString |
||||||
- |
| , #{file.durationString} |
||||||
const splitPost = post.message.split('\n'); |
| ) |
||||||
const messageLines = splitPost.length; |
.post-file-src |
||||||
let truncatedMessage = post.message; |
a(target='_blank' href=`/img/${file.filename}`) |
||||||
if (messageLines > 10) { |
if post.spoiler |
||||||
truncatedMessage = splitPost.slice(0, 10).join('\n'); |
img.file-thumb(src='/img/spoiler.png' width='128' height='128') |
||||||
} else if (post.message.length > 1000) { |
else if file.hasThumb |
||||||
truncatedMessage = post.message.substring(0,1000).replace(/<([\w]+)?([^>]*)?$/, ''); |
object.file-thumb(data=`/img/thumb-${file.filename.split('.')[0]}.jpg`) |
||||||
} |
img(src='/img/deleted.png') |
||||||
pre.post-message !{truncatedMessage} |
else |
||||||
if truncatedMessage !== post.message |
object.file-thumb(data=`/img/${file.filename}`) |
||||||
blockquote Message too long. #[a(href=postURL) View the full text] |
img(src='/img/deleted.png') |
||||||
else |
if post.message |
||||||
pre.post-message !{post.message} |
if truncate |
||||||
if post.banmessage |
- |
||||||
blockquote.banmessage USER WAS BANNED FOR THIS POST (#{post.banmessage}) |
const splitPost = post.message.split('\n'); |
||||||
if post.omittedposts || post.omittedimages |
const messageLines = splitPost.length; |
||||||
blockquote #{post.omittedposts} post(s)#{post.omittedimages > 0 ? ' and '+post.omittedimages+' image(s)' : ''} omitted. #[a(href=postURL) View the full thread] |
let truncatedMessage = post.message; |
||||||
if post.backlinks && post.backlinks.length > 0 |
if (messageLines > 10) { |
||||||
.replies Replies: |
truncatedMessage = splitPost.slice(0, 10).join('\n'); |
||||||
each backlink in post.backlinks |
} else if (post.message.length > 1000) { |
||||||
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink}`) >>#{backlink} |
truncatedMessage = post.message.substring(0,1000).replace(/<([\w]+)?([^>]*)?$/, ''); |
||||||
| |
} |
||||||
if manage === true |
pre.post-message !{truncatedMessage} |
||||||
each report in post.reports |
if truncatedMessage !== post.message |
||||||
.reports.post-container |
blockquote Message too long. #[a(href=postURL) View the full text] |
||||||
span Date: #{report.date.toLocaleString()} |
else |
||||||
| |
pre.post-message !{post.message} |
||||||
span Reason: #{report.reason} |
if post.banmessage |
||||||
if globalmanage === true |
blockquote.banmessage USER WAS BANNED FOR THIS POST (#{post.banmessage}) |
||||||
each report in post.globalreports |
if post.omittedposts || post.omittedimages |
||||||
.reports.post-container |
blockquote #{post.omittedposts} post(s)#{post.omittedimages > 0 ? ' and '+post.omittedimages+' image(s)' : ''} omitted. #[a(href=postURL) View the full thread] |
||||||
span Date: #{report.date.toLocaleString()} |
if post.backlinks && post.backlinks.length > 0 |
||||||
| |
.replies Replies: |
||||||
span Reason: #{report.reason} |
each backlink in post.backlinks |
||||||
|
a.quote(href=`/${post.board}/thread/${post.thread || post.postId}.html#${backlink}`) >>#{backlink} |
||||||
|
| |
||||||
|
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} |
||||||
|
Loading…
Reference in new issue