diff options
Diffstat (limited to 'src/mixins')
-rw-r--r-- | src/mixins/comment.pug | 35 |
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 | ||
3 | mixin infoContainer(data) | 3 | mixin 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 | | · |
7 | span(class=`${data.is_submitter ? 'op' : ''}`) | ||
8 | | u/#{data.author} #{data.is_submitter ? '(op)' : ''} | ||
9 | | · | ||
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 | | · |
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 | ||