aboutsummaryrefslogtreecommitdiff
path: root/src/views/comments.pug
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/comments.pug')
-rw-r--r--src/views/comments.pug19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/views/comments.pug b/src/views/comments.pug
index d7a8ab4..9d02a01 100644
--- a/src/views/comments.pug
+++ b/src/views/comments.pug
@@ -21,17 +21,28 @@ html
21 if post.is_gallery && post.is_gallery == true 21 if post.is_gallery && post.is_gallery == true
22 if post.gallery_data 22 if post.gallery_data
23 if post.gallery_data.items 23 if post.gallery_data.items
24 each item in post.gallery_data.items 24 div.gallery
25 - var url = `https://i.redd.it/${item.media_id}.jpg` 25 - var total = post.gallery_data.items.length
26 img(src=url).post-media 26 - var idx = 0
27 if (post.post_hint == "image" || post.post_hint == "link") && post.thumbnail && post.thumbnail != "self" && post.thumbnail != "default" 27 each item in post.gallery_data.items
28 - var url = `https://i.redd.it/${item.media_id}.jpg`
29 div.gallery-item
30 a(href=`/media/${url}`)
31 img(src=url loading="lazy")
32 div.gallery-item-idx
33 | #{`${++idx}/${total}`}
34 else if post.post_hint == "image" && post.thumbnail && post.thumbnail != "self" && post.thumbnail != "default"
28 img(src=post.url).post-media 35 img(src=post.url).post-media
29 else if post.post_hint == 'hosted:video' 36 else if post.post_hint == 'hosted:video'
30 - var url = post.secure_media.reddit_video.dash_url 37 - var url = post.secure_media.reddit_video.dash_url
31 video(controls data-dashjs-player src=`${url}`).post-media 38 video(controls data-dashjs-player src=`${url}`).post-media
39 else if post.post_hint == "link" && post.thumbnail && post.thumbnail != "self" && post.thumbnail != "default"
40 a(href=`${post.url}`)
41 | #{post.url}
32 42
33 if post.selftext_html 43 if post.selftext_html
34 p.self-text !{post.selftext_html} 44 p.self-text !{post.selftext_html}
45
35 div.info-container 46 div.info-container
36 p 47 p
37 | #{fmtnum(post.ups)} ↑ 48 | #{fmtnum(post.ups)} ↑