aboutsummaryrefslogtreecommitdiff
path: root/src/mixins/comment.pug
blob: 545ee59cbd573d68fc8848a495a92951cf920406 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
include ../utils
mixin comment(com, isfirst)
  - var data = com.data
  - var kind = com.kind
  if kind == "more"
    div(class=`${isfirst?'first':''}`)
      div.more #{data.count} more comments
  else
    div(class=`comment ${isfirst?'first':''}`)
      div.comment-info-container
        div.info-item u/#{data.author}
        div.info-item#{fmtnum(data.ups)}
        if data.collapsed_reason_code == "DELETED"
          div.info-item 
            a(href=`https://undelete.pullpush.io${data.permalink}`) search on undelete
      div.comment-body 
        != data.body_html
      div.replies
      if data.replies
        if data.replies.data
          if data.replies.data.children
            each reply in data.replies.data.children
              +comment(reply,false)