|
|
|
mixin catalogtile(post, index)
|
|
|
|
- let anchorSubject = post.subject;
|
|
|
|
if post.subject
|
|
|
|
- const subjectAnchorMatch = post.subject.match(/^\/\w+\//);
|
|
|
|
if subjectAnchorMatch
|
|
|
|
- anchorSubject = subjectAnchorMatch[0]
|
|
|
|
.anchor(id=`${post.board}-${anchorSubject}`)
|
|
|
|
.catalog-tile(data-board=post.board
|
|
|
|
data-post-id=post.postId
|
|
|
|
data-user-id=post.userId
|
|
|
|
data-name=post.name
|
|
|
|
data-tripcode=post.tripcode
|
|
|
|
data-subject=post.subject
|
|
|
|
data-filter=((post.subject+post.nomarkup).toLowerCase() || '')
|
|
|
|
data-date=post.date
|
|
|
|
data-replies=post.replyposts
|
|
|
|
data-bump=post.bumped)
|
|
|
|
- const postURL = `/${post.board}/${modview ? 'manage/' : ''}thread/${post.postId}.html#${post.postId}`
|
|
|
|
.post-info
|
|
|
|
if !index
|
|
|
|
div
|
|
|
|
| Thread from
|
|
|
|
a.no-decoration.post-subject(href=`/${post.board}/`) /#{post.board}/
|
|
|
|
else
|
|
|
|
input.left.post-check(type='checkbox', name='checkedposts' value=post.postId)
|
|
|
|
if modview
|
|
|
|
a.left.ml-5.bold(href=`recent.html?postid=${post.postId}`) [+]
|
|
|
|
include ../includes/posticons.pug
|
|
|
|
a.no-decoration.post-subject(href=postURL) #{post.subject || 'No subject'}
|
|
|
|
br
|
|
|
|
span(title='Replies') R: #{post.replyposts}
|
|
|
|
| /
|
|
|
|
span(title='Files') F: #{post.replyfiles}
|
|
|
|
if index
|
|
|
|
| /
|
|
|
|
span(title='Page') P: #{Math.ceil(index/10)}
|
|
|
|
if post.files.length > 0
|
|
|
|
.post-file-src
|
|
|
|
a(href=postURL)
|
|
|
|
- const file = post.files[0]
|
|
|
|
if post.spoiler || file.spoiler
|
|
|
|
div.spoilerimg.catalog-thumb
|
|
|
|
else if file.hasThumb
|
|
|
|
img.catalog-thumb(src=`/file/thumb-${file.hash}${file.thumbextension}` width=file.geometry.thumbwidth height=file.geometry.thumbheight loading='lazy')
|
|
|
|
else if file.attachment
|
|
|
|
div.attachmentimg.catalog-thumb(data-mimetype=file.mimetype)
|
|
|
|
else if file.mimetype.startsWith('audio')
|
|
|
|
div.audioimg.catalog-thumb
|
|
|
|
else
|
|
|
|
img.catalog-thumb(src=`/file/${file.filename}` width=file.geometry.width height=file.geometry.height loading='lazy')
|
|
|
|
if post.message
|
|
|
|
pre.no-m-p.post-message !{post.message}
|