aboutsummaryrefslogtreecommitdiff
path: root/src/mixins/comment.pug
diff options
context:
space:
mode:
authorAkshay <[email protected]>2024-11-04 22:01:32 +0000
committerAkshay <[email protected]>2024-11-04 22:01:32 +0000
commit4e586aacad21e48cfb69b4052a5d0aba788709ae (patch)
treeddf5e738f9ea17315cf02f4d3e2a65de7ff5d0a3 /src/mixins/comment.pug
parentd18f24945f35fde4e04b29ab27abce93ffbc6a99 (diff)
fixup info-styles, add collapse everywhere
Diffstat (limited to 'src/mixins/comment.pug')
-rw-r--r--src/mixins/comment.pug35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/mixins/comment.pug b/src/mixins/comment.pug
index 3af1f53..518307d 100644
--- a/src/mixins/comment.pug
+++ b/src/mixins/comment.pug
@@ -2,12 +2,15 @@ include ../utils
2 2
3mixin infoContainer(data) 3mixin infoContainer(data)
4 div.comment-info-container 4 div.comment-info-container
5 div.info-item #{fmtnum(data.ups)} ↑ 5 | #{fmtnum(data.ups)} ↑
6 div.info-item u/#{data.author} #{data.is_submitter ? '(OP)' : ''} 6 | &nbsp;·&nbsp;
7 span(class=`${data.is_submitter ? 'op' : ''}`)
8 | u/#{data.author} #{data.is_submitter ? '(op)' : ''}
9 | &nbsp;·&nbsp;
7 if data.collapsed_reason_code == "DELETED" 10 if data.collapsed_reason_code == "DELETED"
8 div.info-item 11 a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete
9 a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete 12 | &nbsp;·&nbsp;
10 div.info-item #{timeDifference(Date.now(), data.created * 1000)} 13 | #{timeDifference(Date.now(), data.created * 1000)}
11 14
12- 15-
13 function hasReplies(data) { 16 function hasReplies(data) {
@@ -20,22 +23,16 @@ mixin comment(com, isfirst)
20 - var hasReplyData = hasReplies(data) 23 - var hasReplyData = hasReplies(data)
21 24
22 if kind == "more" 25 if kind == "more"
23 div(class=`${isfirst ? 'first' : ''}`) 26 div(class=`more ${isfirst ? 'first' : ''}`)
24 div.more #{data.count} more comments 27 | #{data.count} more comments
25 else 28 else
26 div(class=`comment ${isfirst ? 'first' : ''}`) 29 div(class=`comment ${isfirst ? 'first' : ''}`)
27 if hasReplyData 30 details(id=`${data.id}` open="")
28 details(id=`${data.id}` open="") 31 summary.expand-comments
29 summary.expand-comments 32 +infoContainer(data)
30 +infoContainer(data) 33 div.comment-body
31 div.comment-body 34 != data.body_html
32 != data.body_html 35 if hasReplyData
33
34 div.replies 36 div.replies
35 each reply in data.replies.data.children 37 each reply in data.replies.data.children
36 +comment(reply, false) 38 +comment(reply, false)
37
38 else
39 +infoContainer(data)
40 div.comment-body
41 != data.body_html