Improving Comments theming

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2013-02-28 19:04:20 -08:00
parent 9ff39b377a
commit 721c62f8d6
3 changed files with 6 additions and 13 deletions

View File

@@ -48,7 +48,6 @@ namespace Orchard.Comments.Drivers {
});
return Combined(
ContentShape("Parts_Comment", () => shapeHelper.Parts_Comment(FormattedText: formattedText.Value)),
ContentShape("Parts_Comment_SummaryAdmin", () => shapeHelper.Parts_Comment_SummaryAdmin(FormattedText: formattedText.Value))
);
}

View File

@@ -24,15 +24,15 @@ namespace Orchard.Comments.Handlers {
});
OnLoading<CommentsPart>((context, comments) => {
comments.CommentsField.Loader(list => contentManager
.Query<CommentPart, CommentPartRecord>()
.Where(x => x.CommentsPartRecord == context.ContentItem.As<CommentsPart>().Record && x.Status == CommentStatus.Approved)
comments.CommentsField.Loader(list =>
commentService.GetCommentsForCommentedContent(context.ContentItem.Id)
.Where(x => x.Status == CommentStatus.Approved)
.OrderBy(x => x.Position)
.List().ToList());
comments.PendingCommentsField.Loader(list => contentManager
.Query<CommentPart, CommentPartRecord>()
.Where(x => x.CommentsPartRecord == context.ContentItem.As<CommentsPart>().Record && x.Status == CommentStatus.Pending)
comments.PendingCommentsField.Loader(list =>
commentService.GetCommentsForCommentedContent(context.ContentItem.Id)
.Where(x => x.Status == CommentStatus.Pending)
.List().ToList());
});

View File

@@ -22,12 +22,6 @@
<Place Parts_CommentForm="Content:10.3" />
</Match>
<Match ContentType="Comment" DisplayType="Summary">
<Place Parts_Common_Metadata_Summary="-"
Parts_Comment="Content:10"
/>
</Match>
<Match DisplayType="Summary">
<Place Parts_Comments_Count="Meta:5" />
</Match>