mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#18591: Remove pending comments from comments count
Work Item: 18591 --HG-- branch : 1.x
This commit is contained in:
@@ -17,13 +17,14 @@ namespace Orchard.Comments.Drivers {
|
|||||||
|
|
||||||
var commentsForCommentedContent = _commentService.GetCommentsForCommentedContent(part.ContentItem.Id);
|
var commentsForCommentedContent = _commentService.GetCommentsForCommentedContent(part.ContentItem.Id);
|
||||||
Func<int> pendingCount = () => commentsForCommentedContent.Where(x => x.Status == CommentStatus.Pending).Count();
|
Func<int> pendingCount = () => commentsForCommentedContent.Where(x => x.Status == CommentStatus.Pending).Count();
|
||||||
|
Func<int> approvedCount = () => commentsForCommentedContent.Where(x => x.Status == CommentStatus.Approved).Count();
|
||||||
|
|
||||||
return Combined(
|
return Combined(
|
||||||
|
|
||||||
ContentShape("Parts_Comments_Count",
|
ContentShape("Parts_Comments_Count",
|
||||||
() => shapeHelper.Parts_Comments_Count(CommentCount: commentsForCommentedContent.Count(), PendingCount: pendingCount)),
|
() => shapeHelper.Parts_Comments_Count(CommentCount: approvedCount, PendingCount: pendingCount)),
|
||||||
ContentShape("Parts_Comments_Count_SummaryAdmin",
|
ContentShape("Parts_Comments_Count_SummaryAdmin",
|
||||||
() => shapeHelper.Parts_Comments_Count_SummaryAdmin(CommentCount: commentsForCommentedContent.Count(), PendingCount: pendingCount))
|
() => shapeHelper.Parts_Comments_Count_SummaryAdmin(CommentCount: approvedCount, PendingCount: pendingCount))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,14 +20,15 @@ namespace Orchard.Comments.Drivers {
|
|||||||
|
|
||||||
var commentsForCommentedContent = _commentService.GetCommentsForCommentedContent(part.ContentItem.Id);
|
var commentsForCommentedContent = _commentService.GetCommentsForCommentedContent(part.ContentItem.Id);
|
||||||
Func<int> pendingCount = () => commentsForCommentedContent.Where(x => x.Status == CommentStatus.Pending).Count();
|
Func<int> pendingCount = () => commentsForCommentedContent.Where(x => x.Status == CommentStatus.Pending).Count();
|
||||||
|
Func<int> approvedCount = () => commentsForCommentedContent.Where(x => x.Status == CommentStatus.Approved).Count();
|
||||||
|
|
||||||
return Combined(
|
return Combined(
|
||||||
ContentShape("Parts_Comments",
|
ContentShape("Parts_Comments",
|
||||||
() => shapeHelper.Parts_Comments()),
|
() => shapeHelper.Parts_Comments()),
|
||||||
ContentShape("Parts_Comments_Count",
|
ContentShape("Parts_Comments_Count",
|
||||||
() => shapeHelper.Parts_Comments_Count(CommentCount: commentsForCommentedContent.Count(), PendingCount: pendingCount)),
|
() => shapeHelper.Parts_Comments_Count(CommentCount: approvedCount, PendingCount: pendingCount)),
|
||||||
ContentShape("Parts_Comments_Count_SummaryAdmin",
|
ContentShape("Parts_Comments_Count_SummaryAdmin",
|
||||||
() => shapeHelper.Parts_Comments_Count_SummaryAdmin(CommentCount: commentsForCommentedContent.Count(), PendingCount: pendingCount))
|
() => shapeHelper.Parts_Comments_Count_SummaryAdmin(CommentCount: approvedCount, PendingCount: pendingCount))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user