diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Extensions/HtmlHelperExtensions.cs b/src/Orchard.Web/Modules/Orchard.Comments/Extensions/HtmlHelperExtensions.cs
index 5a8a50dc6..51c9ed94c 100644
--- a/src/Orchard.Web/Modules/Orchard.Comments/Extensions/HtmlHelperExtensions.cs
+++ b/src/Orchard.Web/Modules/Orchard.Comments/Extensions/HtmlHelperExtensions.cs
@@ -6,14 +6,13 @@ using Orchard.Localization;
namespace Orchard.Comments.Extensions {
public static class HtmlHelperExtensions {
public static MvcHtmlString CommentSummaryLinks(this HtmlHelper html, Localizer T, ContentItem item, int commentCount, int pendingCount) {
- string commentText = "";
+ var commentText = "";
if (item.Id != 0) {
- //
- int totalCommentCount = commentCount + pendingCount;
+ var totalCommentCount = commentCount + pendingCount;
if (totalCommentCount == 0) {
- commentText += html.Encode(T("no comments"));
+ commentText += html.Encode(T("0 comments"));
}
else {
commentText +=
@@ -29,8 +28,7 @@ namespace Orchard.Comments.Extensions {
}
if (pendingCount > 0) {
- commentText += " (";
- commentText += html.ActionLink(T("{0} pending", pendingCount).ToString(),
+ commentText += " " + html.ActionLink(T("({0} pending)", pendingCount).ToString(),
"Details",
new {
Area = "Orchard.Comments",
@@ -38,7 +36,6 @@ namespace Orchard.Comments.Extensions {
id = item.Id,
returnUrl = html.ViewContext.HttpContext.Request.Url
});
- commentText += ") ";
}
}
diff --git a/src/Orchard.Web/Themes/Classic/Views/DisplayTemplates/Items/Blogs.BlogPost.Summary.ascx b/src/Orchard.Web/Themes/Classic/Views/DisplayTemplates/Items/Blogs.BlogPost.Summary.ascx
index 7708026f4..3e51b9c82 100644
--- a/src/Orchard.Web/Themes/Classic/Views/DisplayTemplates/Items/Blogs.BlogPost.Summary.ascx
+++ b/src/Orchard.Web/Themes/Classic/Views/DisplayTemplates/Items/Blogs.BlogPost.Summary.ascx
@@ -4,7 +4,7 @@
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
-
<% Html.Zone("primary", ":manage :metadata"); %>
diff --git a/src/Orchard.Web/Themes/Green/Views/DisplayTemplates/Items/Blogs.BlogPost.Summary.ascx b/src/Orchard.Web/Themes/Green/Views/DisplayTemplates/Items/Blogs.BlogPost.Summary.ascx
index c795663ef..88ca5d74a 100644
--- a/src/Orchard.Web/Themes/Green/Views/DisplayTemplates/Items/Blogs.BlogPost.Summary.ascx
+++ b/src/Orchard.Web/Themes/Green/Views/DisplayTemplates/Items/Blogs.BlogPost.Summary.ascx
@@ -5,7 +5,7 @@
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
-
<%=Html.Link(Html.Encode(Model.Item.Title), Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug)) %>
+
<%=Html.Link(Html.Encode(Model.Item.Title), Url.BlogPost(Model.Item)) %>
<%=Html.PublishedState(Model.Item) %> | <%Html.Zone("meta");%>
diff --git a/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs b/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs
index 0c3c9109a..5880be132 100644
--- a/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs
+++ b/src/Orchard/Mvc/Html/HtmlHelperExtensions.cs
@@ -256,6 +256,22 @@ namespace Orchard.Mvc.Html {
#endregion
+ #region AntiForgeryTokenValueOrchardLink
+
+ public static string AntiForgeryTokenValueOrchardLink(this HtmlHelper htmlHelper, string linkContents, string href) {
+ return htmlHelper.Link(linkContents, htmlHelper.AntiForgeryTokenGetUrl(href));
+ }
+
+ #endregion
+
+ #region AntiForgeryTokenGetUrl
+
+ public static string AntiForgeryTokenGetUrl(this HtmlHelper htmlHelper, string baseUrl) {
+ return string.Format("{0}{1}__RequestVerificationToken={2}", baseUrl, baseUrl.IndexOf('?') > -1 ? "&" : "?", htmlHelper.ViewContext.HttpContext.Server.UrlEncode(htmlHelper.AntiForgeryTokenValueOrchard()));
+ }
+
+ #endregion
+
#region AntiForgeryTokenValueOrchard
public static string AntiForgeryTokenValueOrchard(this HtmlHelper htmlHelper) {
@@ -269,4 +285,4 @@ namespace Orchard.Mvc.Html {
#endregion
}
-}
+}
\ No newline at end of file