mirror of https://gitgud.io/fatchan/jschan.git
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.
15 lines
805 B
15 lines
805 B
3 years ago
|
mixin catalogfile(postURL, post, file, small=false)
|
||
|
- const type = file.mimetype.split('/')[0]
|
||
|
.post-file-src
|
||
|
a(href=`${postURL}#${post.postId}`)
|
||
|
if post.spoiler || file.spoiler
|
||
|
div.spoilerimg.catalog-thumb(class=(small?'small':''))
|
||
|
else if file.hasThumb
|
||
|
img.catalog-thumb(class=(small?'small':'') 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(class=(small?'small':'') data-mimetype=file.mimetype)
|
||
|
else if type === 'audio'
|
||
|
div.audioimg.catalog-thumb(class=(small?'small':''))
|
||
|
else
|
||
|
img.catalog-thumb(class=(small?'small':'') src=`/file/${file.filename}` width=file.geometry.width height=file.geometry.height loading='lazy')
|