mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 21:13:35 +08:00
UI cleanup pass (progress - Orchard.Comments)
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045103
This commit is contained in:
@@ -423,20 +423,28 @@ fieldset {
|
||||
margin:0 0 1em;
|
||||
padding:0;
|
||||
}
|
||||
form.comments {
|
||||
|
||||
/* Comments
|
||||
----------------------------------------------------------*/
|
||||
ul.comments {
|
||||
padding:0;
|
||||
}
|
||||
ul.comments li {
|
||||
list-style-type:none;
|
||||
}
|
||||
form.comment {
|
||||
overflow:hidden;
|
||||
}
|
||||
form.comments fieldset.who, form.comments fieldset.what {
|
||||
form.comment fieldset.who, form.comment fieldset.what {
|
||||
float:left;
|
||||
margin-right:15px;
|
||||
}
|
||||
form.comments label {
|
||||
form.comment label {
|
||||
font-weight:bold;
|
||||
margin-top:15px;
|
||||
}
|
||||
form.comments .button {
|
||||
form.comment .button {
|
||||
margin-top:15px;
|
||||
|
||||
}
|
||||
|
||||
/* Tag cloud
|
||||
|
@@ -12,12 +12,13 @@ namespace Orchard.Comments.Controllers {
|
||||
// todo: (heskew) need to be more flexible with displaying parts somehow. e.g. where should the...
|
||||
// comment count go in any given skin or what if the skin builder doesn't want the count
|
||||
if (displayType.StartsWith("Detail")) {
|
||||
return Combined(
|
||||
ContentPartTemplate(part, "Parts/Comments.Count").Location("body", "above.5"),
|
||||
ContentPartTemplate(part, "Parts/Comments.HasComments").Location("body", "below.5"));
|
||||
//return Combined(
|
||||
// ContentPartTemplate(part, "Parts/Comments.Count").Location("body", "above.5"),
|
||||
// ContentPartTemplate(part, "Parts/Comments.HasComments").Location("body", "below.5"));
|
||||
return ContentPartTemplate(part, "Parts/Comments.HasComments").Location("primary", "after.5");
|
||||
}
|
||||
|
||||
return ContentPartTemplate(part, "Parts/Comments.Count").Location("body", "above.5");
|
||||
return ContentPartTemplate(part, "Parts/Comments.Count").Location("primary", "before.5");
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(HasComments part) {
|
||||
|
@@ -90,11 +90,11 @@
|
||||
<Content Include="Views\Admin\Details.aspx" />
|
||||
<Content Include="Views\Admin\Edit.aspx" />
|
||||
<Content Include="Views\Admin\Index.aspx" />
|
||||
<Content Include="Views\Admin\Create.aspx" />
|
||||
<Content Include="Views\DisplayTemplates\Parts\Comments.HasComments.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Parts\Comments.Count.ascx" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Comments.SiteSettings.ascx" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Comments.HasComments.ascx" />
|
||||
<Content Include="Views\ListOfComments.ascx" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
|
@@ -1,19 +0,0 @@
|
||||
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<CommentsCreateViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Comments.ViewModels"%>
|
||||
<h2><%=Html.TitleForPage("Add Comment") %></h2>
|
||||
<% using(Html.BeginFormAntiForgeryPost()) { %>
|
||||
<%=Html.ValidationSummary() %>
|
||||
<fieldset class="who">
|
||||
<label for="CommentName">Name</label>
|
||||
<input id="CommentName" class="text" name="Name" type="text" value="<%=Model.Name %>" /><br />
|
||||
<label for="CommentEmail">Email</label>
|
||||
<input id="CommentEmail" class="text" name="Email" type="text" value="<%=Model.Email%>" /> <br />
|
||||
<label for="CommentSiteName">SiteName</label>
|
||||
<input id="CommentSiteName" class="text" name="SiteName" type="text" value="<%=Model.SiteName %>" />
|
||||
</fieldset>
|
||||
<fieldset class="what">
|
||||
<label for="CommentText">Leave a comment</label>
|
||||
<textarea id="CommentText" rows="10" cols="30" name="CommentText"><%=Model.CommentText %></textarea>
|
||||
<input type="submit" class="button" value="Save" />
|
||||
</fieldset>
|
||||
<% } %>
|
@@ -1,36 +1,36 @@
|
||||
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<CommentsDetailsViewModel>" %>
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<CommentsDetailsViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Comments.Models"%>
|
||||
<%@ Import Namespace="Orchard.Comments.ViewModels"%>
|
||||
<h2><%=Html.TitleForPage(string.Format("Comments for {0}", Model.DisplayNameForCommentedItem)) %></h2>
|
||||
<h1><%=Html.TitleForPage(T("Comments for {0}", Model.DisplayNameForCommentedItem).ToString()) %></h1>
|
||||
<% using(Html.BeginFormAntiForgeryPost()) { %>
|
||||
<%=Html.ValidationSummary() %>
|
||||
<fieldset class="actions bulk">
|
||||
<label for="publishActions">Actions: </label>
|
||||
<label for="publishActions"><%=_Encoded("Actions:") %></label>
|
||||
<select id="publishActions" name="<%=Html.NameOf(m => m.Options.BulkAction)%>">
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentDetailsBulkAction.None, "Choose action...")%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentDetailsBulkAction.Delete, "Delete")%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentDetailsBulkAction.MarkAsSpam, "Mark as Spam")%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentDetailsBulkAction.None, _Encoded("Choose action...").ToString())%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentDetailsBulkAction.Delete, _Encoded("Delete").ToString())%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentDetailsBulkAction.MarkAsSpam, _Encoded("Mark as Spam").ToString())%>
|
||||
</select>
|
||||
<input class="button roundCorners" type="submit" name="submit.BulkEdit" value="Apply" />
|
||||
<input class="button" type="submit" name="submit.BulkEdit" value="<%=_Encoded("Apply") %>" />
|
||||
</fieldset>
|
||||
<fieldset class="actions bulk">
|
||||
<label for="filterResults">Filter: </label>
|
||||
<label for="filterResults"><%=_Encoded("Filter:")%></label>
|
||||
<select id="filterResults" name="<%=Html.NameOf(m => m.Options.Filter)%>">
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentDetailsFilter.All, "All Comments")%>
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentDetailsFilter.Approved, "Approved Comments")%>
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentDetailsFilter.Spam, "Spam")%>
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentDetailsFilter.All, _Encoded("All Comments").ToString())%>
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentDetailsFilter.Approved, _Encoded("Approved Comments").ToString())%>
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentDetailsFilter.Spam, _Encoded("Spam").ToString())%>
|
||||
</select>
|
||||
<input class="button roundCorners" type="submit" name="submit.Filter" value="Filter"/>
|
||||
<input class="button" type="submit" name="submit.Filter" value="<%=_Encoded("Filter") %>"/>
|
||||
</fieldset>
|
||||
<div class="manage">
|
||||
<% if (Model.CommentsClosedOnItem) {
|
||||
%><%=Html.ActionLink("Enable Comments", "Enable", new { commentedItemId = Model.CommentedItemId }, new { @class = "button" })%><%
|
||||
%><%=Html.ActionLink(T("Enable Comments").ToString(), "Enable", new { commentedItemId = Model.CommentedItemId }, new { @class = "button" })%><%
|
||||
} else {
|
||||
%><%=Html.ActionLink("Close Comments", "Close", new { commentedItemId = Model.CommentedItemId }, new { @class = "button remove" })%><%
|
||||
%><%=Html.ActionLink(T("Close Comments").ToString(), "Close", new { commentedItemId = Model.CommentedItemId }, new { @class = "button remove" })%><%
|
||||
} %>
|
||||
</div>
|
||||
<fieldset>
|
||||
<table class="items" summary="This is a table of the comments in your application">
|
||||
<table class="items" summary="<%=_Encoded("This is a table of the comments for the content item") %>">
|
||||
<colgroup>
|
||||
<col id="Col1" />
|
||||
<col id="Col2" />
|
||||
@@ -42,10 +42,10 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"> ↓<%-- todo: (heskew) something more appropriate for "this applies to the bulk actions --%></th>
|
||||
<th scope="col">Status</th>
|
||||
<th scope="col">Author</th>
|
||||
<th scope="col">Comment</th>
|
||||
<th scope="col">Date</th>
|
||||
<th scope="col"><%=_Encoded("Status") %></th>
|
||||
<th scope="col"><%=_Encoded("Author") %></th>
|
||||
<th scope="col"><%=_Encoded("Comment") %></th>
|
||||
<th scope="col"><%=_Encoded("Date") %></th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -56,24 +56,22 @@
|
||||
%>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" value="<%=Model.Comments[commentIndex].Comment.Id%>" name="<%=Html.NameOf(m => m.Comments[ci].Comment.Id)%>"/>
|
||||
<input type="checkbox" value="true" name="<%=Html.NameOf(m => m.Comments[ci].IsChecked)%>"/>
|
||||
<input type="hidden" value="<%= Model.DisplayNameForCommentedItem %>" name="DisplayNameForCommentedtem" />
|
||||
<input type="hidden" value="<%= Model.CommentedItemId %>" name="CommentedItemId" />
|
||||
<input type="hidden" value="<%=Model.Comments[commentIndex].Comment.Id %>" name="<%=Html.NameOf(m => m.Comments[ci].Comment.Id) %>"/>
|
||||
<input type="checkbox" value="true" name="<%=Html.NameOf(m => m.Comments[ci].IsChecked) %>"/>
|
||||
<input type="hidden" value="<%=Model.DisplayNameForCommentedItem %>" name="DisplayNameForCommentedtem" />
|
||||
<input type="hidden" value="<%=Model.CommentedItemId %>" name="CommentedItemId" />
|
||||
</td>
|
||||
<td><% if (commentEntry.Comment.Status == CommentStatus.Spam) {%> Spam <% } %>
|
||||
<% else {%> Approved <% } %>
|
||||
</td>
|
||||
<td><%= commentEntry.Comment.UserName %></td>
|
||||
<td><% if (commentEntry.Comment.Status == CommentStatus.Spam) { %><%=_Encoded("Spam") %><% } else { %><%=_Encoded("Approved") %><% } %></td>
|
||||
<td><%=Html.Encode(commentEntry.Comment.UserName) %></td>
|
||||
<td>
|
||||
<% if (commentEntry.Comment.CommentText != null) {%>
|
||||
<%= commentEntry.Comment.CommentText.Length > 23 ? commentEntry.Comment.CommentText.Substring(0, 24) : commentEntry.Comment.CommentText %> ...
|
||||
<%=Html.Encode(commentEntry.Comment.CommentText.Length > 23 ? commentEntry.Comment.CommentText.Substring(0, 24) : commentEntry.Comment.CommentText) %><%=_Encoded(" ...") %>
|
||||
<% } %>
|
||||
</td>
|
||||
<td><%= commentEntry.Comment.CommentDate.ToLocalTime() %></td>
|
||||
<td><%=commentEntry.Comment.CommentDate.ToLocalTime() %></td>
|
||||
<td>
|
||||
<%=Html.ActionLink("Edit", "Edit", new {commentEntry.Comment.Id}) %> |
|
||||
<%=Html.ActionLink("Delete", "Delete", new {id = commentEntry.Comment.Id, redirectToAction = "Details"}) %>
|
||||
<%=Html.ActionLink(T("Edit").ToString(), "Edit", new {commentEntry.Comment.Id}) %> |
|
||||
<%=Html.ActionLink(T("Delete").ToString(), "Delete", new {id = commentEntry.Comment.Id, redirectToAction = "Details"}) %>
|
||||
</td>
|
||||
</tr>
|
||||
<%
|
||||
@@ -83,9 +81,9 @@
|
||||
</fieldset>
|
||||
<div class="manage">
|
||||
<% if (Model.CommentsClosedOnItem) {
|
||||
%><%=Html.ActionLink("Enable Comments", "Enable", new { commentedItemId = Model.CommentedItemId }, new { @class = "button" })%><%
|
||||
%><%=Html.ActionLink(T("Enable Comments").ToString(), "Enable", new { commentedItemId = Model.CommentedItemId }, new { @class = "button" })%><%
|
||||
} else {
|
||||
%><%=Html.ActionLink("Close Comments", "Close", new { commentedItemId = Model.CommentedItemId }, new { @class = "button remove" })%><%
|
||||
%><%=Html.ActionLink(T("Close Comments").ToString(), "Close", new { commentedItemId = Model.CommentedItemId }, new { @class = "button remove" })%><%
|
||||
} %>
|
||||
</div>
|
||||
<% } %>
|
@@ -1,31 +1,41 @@
|
||||
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<CommentsEditViewModel>" %>
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<CommentsEditViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Comments.Models"%>
|
||||
<%@ Import Namespace="Orchard.Comments.ViewModels"%>
|
||||
<h2><%=Html.TitleForPage("Edit Comment")%></h2>
|
||||
<h1><%=Html.TitleForPage(T("Edit Comment").ToString())%></h1>
|
||||
<% using(Html.BeginFormAntiForgeryPost()) { %>
|
||||
<%= Html.ValidationSummary() %>
|
||||
<fieldset class="who">
|
||||
<label for="CommentName">Name</label>
|
||||
<input id="CommentName" class="text" name="Name" type="text" value="<%=Model.Name %>" /><br />
|
||||
<label for="CommentEmail">Email</label>
|
||||
<input id="CommentEmail" class="text" name="Email" type="text" value="<%=Model.Email%>" /> <br />
|
||||
<label for="CommentSiteName">SiteName</label>
|
||||
<input id="CommentSiteName" class="text" name="SiteName" type="text" value="<%=Model.SiteName %>" />
|
||||
<div>
|
||||
<label for="Name"><%=_Encoded("Name") %></label>
|
||||
<input id="Name" class="text" name="Name" type="text" value="<%=Html.Encode(Model.Name) %>" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="Email"><%=_Encoded("Email") %></label>
|
||||
<input id="Email" class="text" name="Email" type="text" value="<%=Html.Encode(Model.Email)%>" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="SiteName"><%=_Encoded("Url") %></label>
|
||||
<input id="SiteName" class="text" name="SiteName" type="text" value="<%=Html.Encode(Model.SiteName) %>" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="what">
|
||||
<label for="CommentText">Leave a comment</label>
|
||||
<textarea id="Textarea1" rows="10" cols="30" name="CommentText"><%=Model.CommentText %></textarea>
|
||||
<div>
|
||||
<label for="CommentText"><%=_Encoded("Body") %></label>
|
||||
<textarea id="CommentText" rows="10" cols="30" name="CommentText"><%=Html.Encode(Model.CommentText) %></textarea>
|
||||
<input id="CommentId" name="Id" type="hidden" value="<%=Model.Id %>" />
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label for="Status_Approved">
|
||||
<%=Html.RadioButton("Status", "Approved", (Model.Status == CommentStatus.Approved), new { id = "Status_Approved" }) %> Approved
|
||||
</label>
|
||||
<label for="Status_Spam">
|
||||
<%=Html.RadioButton("Status", "Spam", (Model.Status == CommentStatus.Spam), new { id = "Status_Spam" }) %> Mark As Spam
|
||||
</label>
|
||||
<div>
|
||||
<%=Html.RadioButton("Status", "Approved", (Model.Status == CommentStatus.Approved), new { id = "Status_Approved" }) %>
|
||||
<label class="forcheckbox" for="Status_Approved"><%=_Encoded("Approved") %></label>
|
||||
</div>
|
||||
<div>
|
||||
<%=Html.RadioButton("Status", "Spam", (Model.Status == CommentStatus.Spam), new { id = "Status_Spam" }) %>
|
||||
<label class="forcheckbox" for="Status_Spam"><%=_Encoded("Mark as spam") %></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<input type="submit" class="button" value="Save" />
|
||||
<input type="submit" class="button" value="<%=_Encoded("Save") %>" />
|
||||
</fieldset>
|
||||
<% } %>
|
@@ -1,29 +1,29 @@
|
||||
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<CommentsIndexViewModel>" %>
|
||||
<%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<CommentsIndexViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Comments.Models"%>
|
||||
<%@ Import Namespace="Orchard.Comments.ViewModels"%>
|
||||
<h2><%=Html.TitleForPage("Manage Comments")%></h2>
|
||||
<h1><%=Html.TitleForPage(T("Manage Comments").ToString())%></h1>
|
||||
<% using(Html.BeginFormAntiForgeryPost()) { %>
|
||||
<%=Html.ValidationSummary() %>
|
||||
<fieldset class="actions bulk">
|
||||
<label for="publishActions">Actions: </label>
|
||||
<label for="publishActions"><%=_Encoded("Actions:") %></label>
|
||||
<select id="publishActions" name="<%=Html.NameOf(m => m.Options.BulkAction)%>">
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentIndexBulkAction.None, "Choose action...")%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentIndexBulkAction.Delete, "Delete")%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentIndexBulkAction.MarkAsSpam, "Mark as Spam")%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentIndexBulkAction.None, _Encoded("Choose action...").ToString()) %>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentIndexBulkAction.Delete, _Encoded("Delete").ToString())%>
|
||||
<%=Html.SelectOption(Model.Options.BulkAction, CommentIndexBulkAction.MarkAsSpam, _Encoded("Mark as Spam").ToString()) %>
|
||||
</select>
|
||||
<input class="button" type="submit" name="submit.BulkEdit" value="Apply" />
|
||||
<input class="button" type="submit" name="submit.BulkEdit" value="<%=_Encoded("Apply") %>" />
|
||||
</fieldset>
|
||||
<fieldset class="actions bulk">
|
||||
<label for="filterResults">Filter: </label>
|
||||
<label for="filterResults"><%=_Encoded("Filter:")%></label>
|
||||
<select id="filterResults" name="<%=Html.NameOf(m => m.Options.Filter)%>">
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentIndexFilter.All, "All Comments")%>
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentIndexFilter.Approved, "Approved Comments")%>
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentIndexFilter.Spam, "Spam")%>
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentIndexFilter.All, _Encoded("All Comments").ToString()) %>
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentIndexFilter.Approved, _Encoded("Approved Comments").ToString()) %>
|
||||
<%=Html.SelectOption(Model.Options.Filter, CommentIndexFilter.Spam, _Encoded("Spam").ToString())%>
|
||||
</select>
|
||||
<input class="button" type="submit" name="submit.Filter" value="Filter"/>
|
||||
<input class="button" type="submit" name="submit.Filter" value="<%=_Encoded("Filter") %>"/>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<table class="items" summary="This is a table of the comments in your application">
|
||||
<table class="items" summary="<%=_Encoded("This is a table of the comments in your application") %>">
|
||||
<colgroup>
|
||||
<col id="Col1" />
|
||||
<col id="Col2" />
|
||||
@@ -36,11 +36,11 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"> ↓<%-- todo: (heskew) something more appropriate for "this applies to the bulk actions --%></th>
|
||||
<th scope="col">Status</th>
|
||||
<th scope="col">Author</th>
|
||||
<th scope="col">Comment</th>
|
||||
<th scope="col">Date</th>
|
||||
<th scope="col">Commented On</th>
|
||||
<th scope="col"><%=_Encoded("Status") %></th>
|
||||
<th scope="col"><%=_Encoded("Author") %></th>
|
||||
<th scope="col"><%=_Encoded("Comment") %></th>
|
||||
<th scope="col"><%=_Encoded("Date") %></th>
|
||||
<th scope="col"><%=_Encoded("Commented On") %></th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -51,25 +51,22 @@
|
||||
%>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" value="<%=Model.Comments[commentIndex].Comment.Id%>" name="<%=Html.NameOf(m => m.Comments[ci].Comment.Id)%>"/>
|
||||
<input type="checkbox" value="true" name="<%=Html.NameOf(m => m.Comments[ci].IsChecked)%>"/>
|
||||
<input type="hidden" value="<%=Model.Comments[commentIndex].Comment.Id %>" name="<%=Html.NameOf(m => m.Comments[ci].Comment.Id) %>"/>
|
||||
<input type="checkbox" value="true" name="<%=Html.NameOf(m => m.Comments[ci].IsChecked) %>"/>
|
||||
</td>
|
||||
<td><% if (commentEntry.Comment.Status == CommentStatus.Spam) {%> Spam <% } %>
|
||||
<% else {%> Approved <% } %>
|
||||
</td>
|
||||
<td><%= commentEntry.Comment.UserName %></td>
|
||||
<td><% if (commentEntry.Comment.Status == CommentStatus.Spam) { %><%=_Encoded("Spam") %><% } else { %><%=_Encoded("Approved") %><% } %></td>
|
||||
<td><%=Html.Encode(commentEntry.Comment.UserName) %></td>
|
||||
<td>
|
||||
<% if (commentEntry.Comment.CommentText != null) {%>
|
||||
<%= commentEntry.Comment.CommentText.Length > 23 ? commentEntry.Comment.CommentText.Substring(0, 24) : commentEntry.Comment.CommentText %> ...
|
||||
<%-- todo: (heskew) same text processing comment as on the public display, also need to use the ellipsis character instead of ... --%>
|
||||
<%=Html.Encode(commentEntry.Comment.CommentText.Length > 23 ? commentEntry.Comment.CommentText.Substring(0, 24) : commentEntry.Comment.CommentText) %><%=_Encoded(" ...") %>
|
||||
<% } %>
|
||||
</td>
|
||||
<td><%= commentEntry.Comment.CommentDate.ToLocalTime() %></td>
|
||||
<td><%=commentEntry.Comment.CommentDate.ToLocalTime() %></td>
|
||||
<td><%=Html.ActionLink(commentEntry.CommentedOn, "Details", new { id = commentEntry.Comment.CommentedOn }) %></td>
|
||||
<td>
|
||||
<%=Html.ActionLink(commentEntry.CommentedOn, "Details", new {id = commentEntry.Comment.CommentedOn}) %>
|
||||
</td>
|
||||
<td>
|
||||
<%=Html.ActionLink("Edit", "Edit", new {commentEntry.Comment.Id}) %> |
|
||||
<%=Html.ActionLink("Delete", "Delete", new {id = commentEntry.Comment.Id, redirectToAction = "Index"}) %>
|
||||
<%=Html.ActionLink(T("Edit").ToString(), "Edit", new {commentEntry.Comment.Id}) %> |
|
||||
<%=Html.ActionLink(T("Delete").ToString(), "Delete", new { id = commentEntry.Comment.Id, redirectToAction = "Index" }) %>
|
||||
</td>
|
||||
</tr>
|
||||
<%
|
||||
|
@@ -1,38 +1,38 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<HasComments>" %>
|
||||
<%@ Import Namespace="Orchard.Comments.Models"%>
|
||||
<h2 id="comments"><%=_Encoded("{0} Comment{1}", Model.CommentCount, Model.CommentCount == 1 ? "" : "s") %></h2><%
|
||||
foreach (var comment in Model.Comments) { %>
|
||||
<div>
|
||||
<div class="comment">
|
||||
<%--TODO: (erikpo) Need to clean the name and url so nothing dangerous goes out--%>
|
||||
<span class="who"><%=Html.LinkOrDefault(comment.UserName, comment.SiteName, new { rel = "nofollow" })%></span>
|
||||
<span>said <%=Html.Link(Html.DateTimeRelative(comment.CommentDate), "#")%></span>
|
||||
</div>
|
||||
<div class="text">
|
||||
<p><%=Html.Encode(comment.CommentText) %></p>
|
||||
</div>
|
||||
</div><%
|
||||
}
|
||||
if (Model.CommentCount > 0) { Html.RenderPartial("ListOfComments", Model.Comments); }
|
||||
if (Model.CommentsActive == false) { %>
|
||||
<p>Comments have been disabled for this content.</p><%
|
||||
<p><%=_Encoded("Comments have been disabled for this content.") %></p><%
|
||||
} else { %>
|
||||
<% using(Html.BeginForm("Create", "Admin", new { area = "Orchard.Comments" }, FormMethod.Post, new { @class = "comments" })) { %>
|
||||
<%-- 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) %>
|
||||
<label for="Name">Name</label>
|
||||
<input id="Name" class="text" name="Name" type="text" /><br />
|
||||
<label for="Email">Email</label>
|
||||
<input id="Email" class="text" name="Email" type="text" /><br />
|
||||
<label for="SiteName">Url</label>
|
||||
<input id="SiteName" class="text" name="SiteName" type="text" /><br />
|
||||
<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">
|
||||
<label for="CommentText">Leave a comment</label>
|
||||
<textarea id="CommentText" rows="10" cols="30" name="CommentText"></textarea><br />
|
||||
<input type="submit" class="button" value="Submit Comment" />
|
||||
<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><%
|
||||
}
|
||||
} %>
|
||||
|
@@ -0,0 +1,17 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<IEnumerable<Comment>>" %>
|
||||
<%@ Import Namespace="Orchard.Comments.Models"%>
|
||||
<ul class="comments"><%
|
||||
foreach (var comment in Model) { %>
|
||||
<li>
|
||||
<div class="comment">
|
||||
<span class="who"><%=Html.LinkOrDefault(Html.Encode(comment.UserName), Html.Encode(comment.SiteName), new { rel = "nofollow" })%></span>
|
||||
<%-- todo: (heskew) need comment permalink --%>
|
||||
<span>said <%=Html.Link(Html.DateTimeRelative(comment.CommentDate), "#")%></span>
|
||||
</div>
|
||||
<div class="text">
|
||||
<%-- todo: (heskew) comment text needs processing depending on comment markup style --%>
|
||||
<p><%=Html.Encode(comment.CommentText) %></p>
|
||||
</div>
|
||||
</li><%
|
||||
} %>
|
||||
</ul>
|
@@ -18,7 +18,7 @@ namespace Orchard.Tags.Controllers {
|
||||
}
|
||||
|
||||
protected override DriverResult Display(HasTags part, string displayType) {
|
||||
return ContentPartTemplate(part, "Parts/Tags.ShowTags").Location("body:above");
|
||||
return ContentPartTemplate(part, "Parts/Tags.ShowTags").Location("primary", "49");
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(HasTags part) {
|
||||
|
@@ -423,20 +423,28 @@ fieldset {
|
||||
margin:0 0 1em;
|
||||
padding:0;
|
||||
}
|
||||
form.comments {
|
||||
|
||||
/* Comments
|
||||
----------------------------------------------------------*/
|
||||
ul.comments {
|
||||
padding:0;
|
||||
}
|
||||
ul.comments li {
|
||||
list-style-type:none;
|
||||
}
|
||||
form.comment {
|
||||
overflow:hidden;
|
||||
}
|
||||
form.comments fieldset.who, form.comments fieldset.what {
|
||||
form.comment fieldset.who, form.comment fieldset.what {
|
||||
float:left;
|
||||
margin-right:15px;
|
||||
}
|
||||
form.comments label {
|
||||
form.comment label {
|
||||
font-weight:bold;
|
||||
margin-top:15px;
|
||||
}
|
||||
form.comments .button {
|
||||
form.comment .button {
|
||||
margin-top:15px;
|
||||
|
||||
}
|
||||
|
||||
/* Tag cloud
|
||||
|
@@ -40,7 +40,7 @@ namespace Orchard.Mvc.Html {
|
||||
#region UnorderedList
|
||||
|
||||
public static string UnorderedList<T>(this HtmlHelper htmlHelper, IEnumerable<T> items, Func<T, int, string> generateContent, string cssClass) {
|
||||
return htmlHelper.UnorderedList(items, generateContent, cssClass, null, (string)null);
|
||||
return htmlHelper.UnorderedList(items, generateContent, cssClass, null, null);
|
||||
}
|
||||
|
||||
public static string UnorderedList<T>(this HtmlHelper htmlHelper, IEnumerable<T> items, Func<T, int, string> generateContent, string cssClass, string itemCssClass, string alternatingItemCssClass) {
|
||||
|
Reference in New Issue
Block a user