diff options
Diffstat (limited to 'src/mixins/post.pug')
-rw-r--r-- | src/mixins/post.pug | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mixins/post.pug b/src/mixins/post.pug index 8a66d53..20ec7c8 100644 --- a/src/mixins/post.pug +++ b/src/mixins/post.pug | |||
@@ -9,9 +9,9 @@ mixin post(p) | |||
9 | span.domain (#{p.domain}) | 9 | span.domain (#{p.domain}) |
10 | div.info-container | 10 | div.info-container |
11 | p | 11 | p |
12 | | ↑ #{fmtnum(p.ups)} | 12 | | #{fmtnum(p.ups)} ↑ |
13 | | · | 13 | | · |
14 | a(href=`/comments/${p.id}`) #{fmtnum (p.num_comments)} replies | 14 | a(href=`/comments/${p.id}`) #{fmtnum (p.num_comments)} ↩ |
15 | | · | 15 | | · |
16 | a(href=`/r/${p.subreddit}`) r/#{p.subreddit} | 16 | a(href=`/r/${p.subreddit}`) r/#{p.subreddit} |
17 | span.post-author | 17 | span.post-author |
@@ -36,12 +36,14 @@ mixin post(p) | |||
36 | if p.gallery_data.items | 36 | if p.gallery_data.items |
37 | details(id=`${p.id}`) | 37 | details(id=`${p.id}`) |
38 | summary expand gallery | 38 | summary expand gallery |
39 | each item in p.gallery_data.items | 39 | div.gallery |
40 | - var url = `https://i.redd.it/${item.media_id}.jpg` | 40 | each item in p.gallery_data.items |
41 | a(href=`/media/${url}`) | 41 | - var url = `https://i.redd.it/${item.media_id}.jpg` |
42 | img(src=url).post-media | 42 | div.gallery-item |
43 | a(href=`/media/${url}`) | ||
44 | img(src=url) | ||
43 | button(onclick=`toggleDetails('${p.id}')`) close | 45 | button(onclick=`toggleDetails('${p.id}')`) close |
44 | if (p.post_hint == "image" || p.post_hint == "link") && p.thumbnail && p.thumbnail != "self" && p.thumbnail != "default" | 46 | if p.post_hint == "image" && p.thumbnail && p.thumbnail != "self" && p.thumbnail != "default" |
45 | details(id=`${p.id}`) | 47 | details(id=`${p.id}`) |
46 | summary expand image | 48 | summary expand image |
47 | a(href=`/media/${p.url}`) | 49 | a(href=`/media/${p.url}`) |
@@ -53,4 +55,10 @@ mixin post(p) | |||
53 | - var url = p.secure_media.reddit_video.dash_url | 55 | - var url = p.secure_media.reddit_video.dash_url |
54 | video(src=url controls data-dashjs-player).post-media | 56 | video(src=url controls data-dashjs-player).post-media |
55 | button(onclick=`toggleDetails('${p.id}')`) close | 57 | button(onclick=`toggleDetails('${p.id}')`) close |
56 | 58 | else if p.post_hint == "link" && p.thumbnail && p.thumbnail != "self" && p.thumbnail != "default" | |
59 | details(id=`${p.id}`) | ||
60 | summary expand link | ||
61 | a(href=`${p.url}`) | ||
62 | | #{p.url} | ||
63 | br | ||
64 | button(onclick=`toggleDetails('${p.id}')`) close | ||