diff options
Diffstat (limited to 'src/mixins/comment.pug')
-rw-r--r-- | src/mixins/comment.pug | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mixins/comment.pug b/src/mixins/comment.pug new file mode 100644 index 0000000..ec01dad --- /dev/null +++ b/src/mixins/comment.pug | |||
@@ -0,0 +1,20 @@ | |||
1 | include ../utils | ||
2 | mixin comment(com, isfirst) | ||
3 | - var data = com.data | ||
4 | - var kind = com.kind | ||
5 | if kind == "more" | ||
6 | div(class=`${isfirst?'first':''}`) | ||
7 | div.more #{data.count} more comments | ||
8 | else | ||
9 | div(class=`comment ${isfirst?'first':''}`) | ||
10 | div.comment-info-container | ||
11 | div.info-item u/#{data.author} | ||
12 | div.info-item ↑ #{fmtnum(data.ups)} | ||
13 | div.comment-body | ||
14 | != data.body_html | ||
15 | div.replies | ||
16 | if data.replies | ||
17 | if data.replies.data | ||
18 | if data.replies.data.children | ||
19 | each reply in data.replies.data.children | ||
20 | +comment(reply,false) | ||