code: protected void renderComments(PageRequestContext requestContext, QueryPage queryPage, QueryReply queryReply, boolean commentable, boolean viewDiscussion) {
      Query query = queryPage.getQuerySection().getQuery();
      Panel panel = ResourceUtils.getResourcePanel(query);
      
      RequiredQueryFragment queryFragment = new RequiredQueryFragment("comments");
      queryFragment.addAttribute("panelId", panel.getId().toString());
      queryFragment.addAttribute("queryId", query.getId().toString());
      queryFragment.addAttribute("pageId", queryPage.getId().toString());
      
      if (queryReply != null) {
        queryFragment.addAttribute("queryReplyId", queryReply.getId().toString());
      }
      
      queryFragment.addAttribute("queryPageCommentable", commentable ? "true" : "false");
      queryFragment.addAttribute("queryViewDiscussion", viewDiscussion ? "true" : "false");
      addRequiredFragment(requestContext, queryFragment);  
    }
docs: Renders comment list and comment editor
  
  @param requestContext request context
  @param queryPage query page
  @param queryReply query reply
  @param commentable whether to render comment editor
  @param viewDiscussion whether to render comment list