コード例 #1
0
ファイル: comment.js プロジェクト: jgabios/ringopress
var getCommentsByPostId = function(postId){
    var comments = model.Comment.query().equals('postid',postId).equals('spam',false).orderBy('createTime','desc').select();
    for(var i=0;i<comments.length;i++){
      comments[i].gravatarHash = getCommentGravatarHash(comments[i].email);
    }
    return comments;
}
コード例 #2
0
ファイル: comment.js プロジェクト: jgabios/ringopress
var getPageComments = function(currentPage){
    return model.Comment.query().orderBy('createTime','desc').offset(currentPage*CONSTANTS.POSTS_PER_PAGE).limit(CONSTANTS.POSTS_PER_PAGE).select();
}
コード例 #3
0
ファイル: comment.js プロジェクト: jgabios/ringopress
var isCommentAuthorWhitelisted = function(email){
    var commentsApprovedForThisEmail = model.Comment.query().equals('email',email).equals('spam',false).select();
    return commentsApprovedForThisEmail.length>0;
}
コード例 #4
0
ファイル: comment.js プロジェクト: jgabios/ringopress
var getCommentById = function(id){
    return model.Comment.get(id);
}