diff options
Diffstat (limited to 'src/mixins')
-rw-r--r-- | src/mixins/comment.pug | 7 | ||||
-rw-r--r-- | src/mixins/post.pug | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/mixins/comment.pug b/src/mixins/comment.pug index 99231d8..f6d7b5e 100644 --- a/src/mixins/comment.pug +++ b/src/mixins/comment.pug | |||
@@ -17,13 +17,14 @@ mixin infoContainer(data) | |||
17 | return data.replies && data.replies.data && data.replies.data.children && data.replies.data.children.length > 0; | 17 | return data.replies && data.replies.data && data.replies.data.children && data.replies.data.children.length > 0; |
18 | } | 18 | } |
19 | 19 | ||
20 | mixin comment(com, isfirst) | 20 | mixin comment(com, isfirst, parent_id) |
21 | - var data = com.data | 21 | - var data = com.data |
22 | - var hasReplyData = hasReplies(data) | 22 | - var hasReplyData = hasReplies(data) |
23 | 23 | ||
24 | if com.kind == "more" | 24 | if com.kind == "more" |
25 | div(class=`more ${isfirst ? 'first' : ''}`) | 25 | div(class=`more ${isfirst ? 'first' : ''}`) |
26 | | #{data.count} more #{fmttxt(data.count, 'comment')} | 26 | a(href=`/comments/${parent_id}/comment/${data.id}`) |
27 | | #{data.count} more #{fmttxt(data.count, 'comment')} | ||
27 | else | 28 | else |
28 | div(class=`comment ${isfirst ? 'first' : ''}`) | 29 | div(class=`comment ${isfirst ? 'first' : ''}`) |
29 | details(id=`${data.id}` open="") | 30 | details(id=`${data.id}` open="") |
@@ -34,4 +35,4 @@ mixin comment(com, isfirst) | |||
34 | if hasReplyData | 35 | if hasReplyData |
35 | div.replies | 36 | div.replies |
36 | each reply in data.replies.data.children | 37 | each reply in data.replies.data.children |
37 | +comment(reply, false) | 38 | +comment(reply, false, parent_id) |
diff --git a/src/mixins/post.pug b/src/mixins/post.pug index 43a3eb8..172da32 100644 --- a/src/mixins/post.pug +++ b/src/mixins/post.pug | |||
@@ -31,7 +31,7 @@ mixin post(p) | |||
31 | else if p.post_hint == "hosted:video" | 31 | else if p.post_hint == "hosted:video" |
32 | - var url = p.secure_media.reddit_video.scrubber_media_url | 32 | - var url = p.secure_media.reddit_video.scrubber_media_url |
33 | video(src=url data-dashjs-player width='100px' height='100px' onclick=`toggleDetails('${p.id}')`) | 33 | video(src=url data-dashjs-player width='100px' height='100px' onclick=`toggleDetails('${p.id}')`) |
34 | else if !p.selftext | 34 | else if p.post_hint == "link" |
35 | a(href=p.url) | 35 | a(href=p.url) |
36 | | ↗ | 36 | | ↗ |
37 | 37 | ||
@@ -75,7 +75,7 @@ mixin post(p) | |||
75 | - var url = p.secure_media.reddit_video.dash_url | 75 | - var url = p.secure_media.reddit_video.dash_url |
76 | video(src=url controls data-dashjs-player loading="lazy").post-media | 76 | video(src=url controls data-dashjs-player loading="lazy").post-media |
77 | button(onclick=`toggleDetails('${p.id}')`) close | 77 | button(onclick=`toggleDetails('${p.id}')`) close |
78 | else if !p.selftext | 78 | else if p.post_hint == "link" |
79 | details(id=`${p.id}`) | 79 | details(id=`${p.id}`) |
80 | summary.expand-post expand link | 80 | summary.expand-post expand link |
81 | a(href=`${p.url}`) | 81 | a(href=`${p.url}`) |