parent
6d6803b5a8
commit
ca852d51b1
@ -1,4 +1,4 @@
|
|||||||
include ../../components/library
|
include ../../components/library
|
||||||
include comment-list
|
include comment-list
|
||||||
include composer
|
include composer
|
||||||
+renderCommentList(comments)
|
+renderCommentList(comments, { rootUrl: `/post/${post.slug}/comment`, countPerPage })
|
@ -1,11 +1,21 @@
|
|||||||
include comment
|
include comment
|
||||||
|
|
||||||
mixin renderCommentList (comments)
|
mixin renderCommentList (comments, options = { })
|
||||||
if Array.isArray(comments) && (comments.length > 0)
|
if Array.isArray(comments) && (comments.length > 0)
|
||||||
ul#post-comment-list.uk-list.uk-list-divider.uk-list-large
|
ul#post-comment-list.uk-list.uk-list-divider.uk-list-large
|
||||||
each comment in comments
|
each comment in comments
|
||||||
li(data-comment-id= comment._id)
|
li(data-comment-id= comment._id)
|
||||||
+renderComment(comment)
|
+renderComment(comment)
|
||||||
|
|
||||||
|
if (comments.length >= options.countPerPage)
|
||||||
|
li#load-more.uk-text-center
|
||||||
|
button(
|
||||||
|
type="button",
|
||||||
|
data-post-id= post._id,
|
||||||
|
data-next-page= pagination.p + 1,
|
||||||
|
data-root-url= options.rootUrl,
|
||||||
|
onclick= `return dtp.app.loadMoreComments(event);`,
|
||||||
|
).uk-button.dtp-button-primary LOAD MORE
|
||||||
else
|
else
|
||||||
ul#post-comment-list.uk-list.uk-list-divider.uk-list-large
|
ul#post-comment-list.uk-list.uk-list-divider.uk-list-large
|
||||||
div There are no comments at this time. Please check back later.
|
div There are no comments at this time. Please check back later.
|
@ -0,0 +1,4 @@
|
|||||||
|
include ../../components/library
|
||||||
|
include comment-list
|
||||||
|
include composer
|
||||||
|
+renderCommentList(comments, { rootUrl: `/comment/${comment._id}/replies`, countPerPage })
|
Loading…
Reference in new issue