Files
Orchard/src/Orchard.Web/Packages/Orchard.Comments/Views/DisplayTemplates/Parts/Comments.HasComments.ascx
rpaquay 95d5398f50 bug fixes
* Display comment count in blog post (admin and front-end).
* In admin, also display # of pending comments.
* In admin, both comment count and pending count are hyperlinks to the "manage comments" page for the blog post.
* Fix a few incorrect redirect calls in the comments module
* Removed fake comment count display for aggregate blog view (we will resurrect it later with a correct implementation)

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045823
2010-01-22 02:06:07 +00:00

40 lines
1.9 KiB
Plaintext

<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<HasComments>" %>
<%@ Import Namespace="Orchard.Comments.Models"%>
<h2 id="comments"><%=_Encoded("{0} Comment{1}", Model.Comments.Count, Model.Comments.Count == 1 ? "" : "s")%></h2><%
if (Model.Comments.Count > 0) { Html.RenderPartial("ListOfComments", Model.Comments); }
if (Model.CommentsActive == false) { %>
<p><%=_Encoded("Comments have been disabled for this content.") %></p><%
} else { %>
<%-- todo: (heskew) need a comment form for the authenticated user... --%>
<% using(Html.BeginForm("Create", "Admin", new { area = "Orchard.Comments" }, FormMethod.Post, new { @class = "comment" })) { %>
<%=Html.ValidationSummary() %>
<fieldset class="who">
<%=Html.Hidden("CommentedOn", Model.ContentItem.Id) %>
<%=Html.Hidden("ReturnUrl", Context.Request.Url) %>
<div>
<label for="Name"><%=_Encoded("Name") %></label>
<input id="Name" class="text" name="Name" type="text" />
</div>
<div>
<label for="Email"><%=_Encoded("Email") %></label>
<input id="Email" class="text" name="Email" type="text" />
</div>
<div>
<label for="SiteName"><%=_Encoded("Url") %></label>
<input id="SiteName" class="text" name="SiteName" type="text" />
</div>
</fieldset>
<fieldset class="what">
<div>
<label for="CommentText"><%=_Encoded("Leave a comment") %></label>
<textarea id="CommentText" rows="10" cols="30" name="CommentText"></textarea>
</div>
<div>
<input type="submit" class="button" value="<%=_Encoded("Submit Comment") %>" />
<%=Html.AntiForgeryTokenOrchard() %>
</div>
</fieldset><%
}
} %>