More admin cleanup and consolidation...

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042981
This commit is contained in:
skewed
2009-12-02 22:49:30 +00:00
parent 46f5a1b43e
commit 82752d77a9
43 changed files with 215 additions and 368 deletions

View File

@@ -2,89 +2,81 @@
<%@ Import Namespace="Orchard.Comments.Models"%>
<%@ Import Namespace="Orchard.Comments.ViewModels"%>
<%@ Import Namespace="Orchard.Mvc.Html"%>
<% Html.Include("Header"); %>
<% Html.Include("AdminHead"); %>
<h2>Manage Comments</h2>
<% Html.BeginForm(); %>
<div class="yui-g">
<h2 class="separator">Manage Comments</h2>
<%=Html.ValidationSummary() %>
<ol class="horizontal actions floatLeft">
<li>
<label class="floatLeft" for="publishActions"> 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")%>
</select>
</li>
<li>
<input class="button roundCorners" type="submit" name="submit.BulkEdit" value="Apply" />
</li>
</ol>
<ol class="horizontal actions">
<li>
<label class="floatLeft" for="filterResults"></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")%>
</select>
</li>
<li>
<input class="button roundCorners" type="submit" name="submit.Filter" value="Filter"/>
</li>
</ol>
<table id="Table1" cellspacing="0" class="roundCorners clearLayout" summary="This is a table of the comments in your application">
<colgroup>
<col id="Col1" />
<col id="Col2" />
<col id="Col3" />
<col id="Col4" />
<col id="Col5" />
<col id="Col6" />
<col id="Col7" />
</colgroup>
<thead>
<tr>
<th scope="col"><%--<input type="checkbox" value="" />--%></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"></th>
</tr>
</thead>
<%
int commentIndex = 0;
foreach (var commentEntry in Model.Comments) {
%>
<tr>
<td>
<input type="hidden" value="<%=Model.Comments[commentIndex].Comment.Id%>" name="<%=Html.NameOf(m => m.Comments[commentIndex].Comment.Id)%>"/>
<input type="checkbox" value="true" name="<%=Html.NameOf(m => m.Comments[commentIndex].IsChecked)%>"/>
</td>
<td><% if (commentEntry.Comment.Status == CommentStatus.Spam) {%> Spam <% } %>
<% else {%> Approved <% } %>
</td>
<td><%= commentEntry.Comment.UserName %></td>
<td>
<% if (commentEntry.Comment.CommentText != null) {%>
<%= commentEntry.Comment.CommentText.Length > 23 ? commentEntry.Comment.CommentText.Substring(0, 24) : commentEntry.Comment.CommentText %> ...
<% } %>
</td>
<td><%= commentEntry.Comment.CommentDate %></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"}) %>
</td>
</tr>
<%
commentIndex++;
} %>
</table>
</div>
<%=Html.ValidationSummary() %>
<fieldset class="actions bulk">
<label for="publishActions">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")%>
</select>
<input class="button" type="submit" name="submit.BulkEdit" value="Apply" />
</fieldset>
<fieldset class="actions bulk">
<label for="filterResults">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")%>
</select>
<input class="button" type="submit" name="submit.Filter" value="Filter"/>
</fieldset>
<fieldset>
<table summary="This is a table of the comments in your application">
<colgroup>
<col id="Col1" />
<col id="Col2" />
<col id="Col3" />
<col id="Col4" />
<col id="Col5" />
<col id="Col6" />
<col id="Col7" />
</colgroup>
<thead>
<tr>
<th scope="col">&nbsp;&darr;<%-- 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"></th>
</tr>
</thead>
<%
int commentIndex = 0;
foreach (var commentEntry in Model.Comments) {
%>
<tr>
<td>
<input type="hidden" value="<%=Model.Comments[commentIndex].Comment.Id%>" name="<%=Html.NameOf(m => m.Comments[commentIndex].Comment.Id)%>"/>
<input type="checkbox" value="true" name="<%=Html.NameOf(m => m.Comments[commentIndex].IsChecked)%>"/>
</td>
<td><% if (commentEntry.Comment.Status == CommentStatus.Spam) {%> Spam <% } %>
<% else {%> Approved <% } %>
</td>
<td><%= commentEntry.Comment.UserName %></td>
<td>
<% if (commentEntry.Comment.CommentText != null) {%>
<%= commentEntry.Comment.CommentText.Length > 23 ? commentEntry.Comment.CommentText.Substring(0, 24) : commentEntry.Comment.CommentText %> ...
<% } %>
</td>
<td><%= commentEntry.Comment.CommentDate %></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"}) %>
</td>
</tr>
<%
commentIndex++;
} %>
</table>
</fieldset>
<% Html.EndForm(); %>
<% Html.Include("Footer"); %>
<% Html.Include("AdminFoot"); %>