DTP Social Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

22 lines
911 B

include comment
mixin renderCommentList (comments, options = { })
if Array.isArray(comments) && (comments.length > 0)
each comment in comments
li(data-comment-id= comment._id)
-
var commentOptions = Object.assign({ }, options);
commentOptions.name = `${options.name}-reply-${comment._id}`;
+renderComment(comment, commentOptions)
if (comments.length >= options.countPerPage)
- var buttonId = mongoose.Types.ObjectId();
li(data-button-id= buttonId).dtp-load-more.uk-text-center
button(
type="button",
data-button-id= buttonId,
data-post-id= post._id,
data-next-page= options.pagination ? options.pagination.p + 1 : 2,
data-root-url= options.rootUrl,
onclick= `return dtp.app.comments['${options.name}'].loadMoreComments(event);`,
).uk-button.dtp-button-primary LOAD MORE