diff --git a/src/Orchard.Web/Packages/Orchard.Comments/Extensions/HtmlHelperExtensions.cs b/src/Orchard.Web/Packages/Orchard.Comments/Extensions/HtmlHelperExtensions.cs index e347aa403..5a8a50dc6 100644 --- a/src/Orchard.Web/Packages/Orchard.Comments/Extensions/HtmlHelperExtensions.cs +++ b/src/Orchard.Web/Packages/Orchard.Comments/Extensions/HtmlHelperExtensions.cs @@ -9,13 +9,16 @@ namespace Orchard.Comments.Extensions { string commentText = ""; if (item.Id != 0) { - if (commentCount == 0) { + // + int totalCommentCount = commentCount + pendingCount; + + if (totalCommentCount == 0) { commentText += html.Encode(T("no comments")); } else { commentText += html.ActionLink( - T("{0} comment{1}", commentCount, commentCount == 1 ? "" : "s").ToString(), + T("{0} comment{1}", totalCommentCount, totalCommentCount == 1 ? "" : "s").ToString(), "Details", new { Area = "Orchard.Comments", @@ -26,7 +29,7 @@ namespace Orchard.Comments.Extensions { } if (pendingCount > 0) { - commentText += " - "; + commentText += " ("; commentText += html.ActionLink(T("{0} pending", pendingCount).ToString(), "Details", new { @@ -35,6 +38,7 @@ namespace Orchard.Comments.Extensions { id = item.Id, returnUrl = html.ViewContext.HttpContext.Request.Url }); + commentText += ") "; } } diff --git a/src/Orchard.Web/Packages/Orchard.Comments/Models/HasCommentsContainerDriver.cs b/src/Orchard.Web/Packages/Orchard.Comments/Models/HasCommentsContainerDriver.cs index da6d5f27c..f10143124 100644 --- a/src/Orchard.Web/Packages/Orchard.Comments/Models/HasCommentsContainerDriver.cs +++ b/src/Orchard.Web/Packages/Orchard.Comments/Models/HasCommentsContainerDriver.cs @@ -25,7 +25,7 @@ namespace Orchard.Comments.Models { .Where(rec => rec.Container == contentItem.Record).List(); // Count comments and create template - int count = parts.Aggregate(0, (seed, item) => seed + (ContentExtensions.Has(item) ? ContentExtensions.As(item).Comments.Count : 0)); + int count = parts.Aggregate(0, (seed, item) => seed + (item.Has() ? item.As().Comments.Count : 0)); int pendingCount = parts.Aggregate(0, (seed, item) => seed + (item.Has() ? item.As().PendingComments.Count : 0)); return new CommentCountViewModel { Item = contentItem, CommentCount = count, PendingCount = pendingCount};