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