More updates to the CMSPages admin UI. A little work left on the edit page (page) and have to rip through the smaller confirmation type pages. Also need to clean up the CSS a bit to reorg selectors I haven't touched yet to one location so the little stuff isn't lost in the (re)shuffle...

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4041983
This commit is contained in:
skewed
2009-11-24 01:51:26 +00:00
parent 4bffb6412d
commit 00acb5ca32
5 changed files with 165 additions and 192 deletions

View File

@@ -2,125 +2,99 @@
<%@ Import Namespace="Orchard.Utility"%>
<%@ Import Namespace="Orchard.CmsPages.ViewModels"%>
<%@ Import Namespace="Orchard.Mvc.Html" %>
<%-- todo: (heskew) not this --%>
<script runat="server">
public string DefaultText(string valueText, string defaultText)
{
if (string.IsNullOrEmpty(valueText))
return defaultText;
return valueText;
}
string SplitDateTime(DateTime dt)
{
return string.Format("{0:d}", dt) + "<br />" +
string.Format("{0:t}", dt);
}
</script>
<%-- todo: (heskew) localize --%>
<% Html.Include("Head"); %>
<% Html.BeginForm(); %>
<div class="yui-g">
<h2>Manage Pages</h2>
<p class="bottomSpacer">
Possible text about setting up a page goes here. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Nulla erat turpis, blandit eget feugiat nec, tempus vel quam. Mauris
et neque eget justo suscipit blandit.</p>
<h2>Manage Pages</h2>
<p>Possible text about setting up a page goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla erat turpis, blandit eget feugiat nec, tempus vel quam. Mauris et neque eget justo suscipit blandit.</p>
<% using (Html.BeginForm()) { %>
<%=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, PageIndexBulkAction.None, "Choose action...")%>
<%=Html.SelectOption(Model.Options.BulkAction, PageIndexBulkAction.PublishNow, "Publish Now")%>
<%=Html.SelectOption(Model.Options.BulkAction, PageIndexBulkAction.PublishLater, "Publish Later")%>
<%=Html.SelectOption(Model.Options.BulkAction, PageIndexBulkAction.Unpublish, "Unpublish")%>
<%=Html.SelectOption(Model.Options.BulkAction, PageIndexBulkAction.Delete, "Delete")%>
</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, PageIndexFilter.All, "All Pages")%>
<%=Html.SelectOption(Model.Options.Filter, PageIndexFilter.Published, "Published Pages")%>
<%=Html.SelectOption(Model.Options.Filter, PageIndexFilter.Offline, "Offline Pages")%>
<%=Html.SelectOption(Model.Options.Filter, PageIndexFilter.Scheduled, "Publish Pending")%>
</select>
</li>
<li>
<input class="button roundCorners" type="submit" name="submit.Filter" value="Filter"/>
</li>
</ol>
<p><%=Html.ActionLink("Add a page", "Create", new {}, new {@class="floatRight topSpacer"}) %></p>
<table id="pluginListTable" cellspacing="0" class="clearLayout" summary="This is a table of the PageEntries currently available for use in your application.">
<colgroup>
<col id="Actions" />
<col id="Status" />
<col id="Title" />
<col id="Author" />
<col id="LastUpdated" />
<col id="Draft" />
<col id="Timer" />
<col id="Edit" />
</colgroup>
<thead>
<tr>
<th scope="col"><%--<input type="checkbox" value="1" name="<%=Html.NameOf(m => m.Options.BulkChecked)%>"/>--%></th>
<th scope="col">Status</th>
<th scope="col">Title</th>
<th scope="col">Slug</th>
<th scope="col">Author</th>
<th scope="col">Last Updated</th>
<th scope="col">Draft</th>
<th scope="col">Scheduled</th>
<th scope="col"></th>
<fieldset class="actions bulk">
<label for="publishActions">Actions: </label>
<select id="publishActions" name="<%=Html.NameOf(m => m.Options.BulkAction) %>">
<%=Html.SelectOption(Model.Options.BulkAction, PageIndexBulkAction.None, "Choose action...") %>
<%=Html.SelectOption(Model.Options.BulkAction, PageIndexBulkAction.PublishNow, "Publish Now") %>
<%=Html.SelectOption(Model.Options.BulkAction, PageIndexBulkAction.PublishLater, "Publish Later") %>
<%=Html.SelectOption(Model.Options.BulkAction, PageIndexBulkAction.Unpublish, "Unpublish") %>
<%=Html.SelectOption(Model.Options.BulkAction, PageIndexBulkAction.Delete, "Delete") %>
</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, PageIndexFilter.All, "All Pages") %>
<%=Html.SelectOption(Model.Options.Filter, PageIndexFilter.Published, "Published Pages") %>
<%=Html.SelectOption(Model.Options.Filter, PageIndexFilter.Offline, "Offline Pages") %>
<%=Html.SelectOption(Model.Options.Filter, PageIndexFilter.Scheduled, "Publish Pending") %>
</select>
<input class="button" type="submit" name="submit.Filter" value="Apply"/>
</fieldset>
<p class="manage"><%=Html.ActionLink("Add a page", "Create", new {}, new { @class = "button" }) %></p>
<fieldset>
<table summary="This is a table of the PageEntries currently available for use in your application.">
<colgroup>
<col id="Actions" />
<col id="Status" />
<col id="Title" />
<col id="Author" />
<col id="LastUpdated" />
<col id="Draft" />
<col id="Timer" />
<col id="Edit" />
</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">Title</th>
<th scope="col">Slug</th>
<th scope="col">Author</th>
<th scope="col">Last Updated</th>
<th scope="col">Draft</th>
<th scope="col">Scheduled</th>
<th scope="col"></th>
</tr>
</thead>
<%
int pageIndex = 0;
foreach (var pageEntry in Model.PageEntries)
{
var revision = pageEntry.Page.Revisions.LastOrDefault();
if (revision == null) continue;
%><tr>
<td>
<input type="hidden" value="<%=Model.PageEntries[pageIndex].PageId %>" name="<%=Html.NameOf(m => m.PageEntries[pageIndex].PageId) %>"/>
<input type="checkbox" value="true" name="<%=Html.NameOf(m => m.PageEntries[pageIndex].IsChecked) %>"/>
</td>
<td>
<% if (pageEntry.IsPublished) {
%><img src="<%=ResolveUrl("~/Packages/Orchard.CmsPages/Content/Admin/images/online.gif") %>" alt="Online" title="The page is currently online" />
<% } else {
%><img src="<%=ResolveUrl("~/Packages/Orchard.CmsPages/Content/Admin/images/offline.gif") %>" alt="Offline" title="The page is currently offline" />
<% } %>
</td>
<td><%=Html.ActionLink(revision.Title ?? "(no title)", "Show", new { Controller = "Templates", revision.Slug }) %></td>
<td><%=Html.ActionLink(revision.Slug ?? "(no slug)", "Show", new { Controller = "Templates", revision.Slug }) %></td>
<td>By Unk</td>
<td><%=string.Format("{0:d}<br />{0:t}", revision.ModifiedDate) %></td>
<td>
<% if (pageEntry.HasDraft) {
%><img src="<%=ResolveUrl("~/Packages/Orchard.CmsPages/Content/Admin/images/draft.gif") %>" alt="Draft" title="The page has a draft" />
<% }
if (revision.Page.Scheduled.Any()) {
%><img src="<%=ResolveUrl("~/Packages/Orchard.CmsPages/Content/Admin/images/scheduled.gif") %>" alt="Scheduled" title="The draft is scheduled for publishing" />
<% } %>
</td>
<td><%=revision.Page.Scheduled.Any() ? string.Format("{0:d}<br />{0:t}", revision.Page.Scheduled.First().ScheduledDate.Value) : "" %></td>
<td><%=Html.ActionLink("Edit", "Edit", new { revision.Page.Id }) %></td>
</tr>
</thead>
<%
int pageIndex = 0;
foreach (var pageEntry in Model.PageEntries) {
var revision = pageEntry.Page.Revisions.LastOrDefault();
if (revision == null)
continue;
%>
<tr>
<td>
<input type="hidden" value="<%=Model.PageEntries[pageIndex].PageId %>" name="<%=Html.NameOf(m => m.PageEntries[pageIndex].PageId)%>"/>
<input type="checkbox" value="true" name="<%=Html.NameOf(m => m.PageEntries[pageIndex].IsChecked)%>"/>
</td>
<td>
<% if (pageEntry.IsPublished) { %>
<img src="<%=ResolveUrl("~/Packages/Orchard.CmsPages/Content/Admin/images/online.gif")%>" alt="Online" title="The page is currently online" />
<% } else { %>
<img src="<%=ResolveUrl("~/Packages/Orchard.CmsPages/Content/Admin/images/offline.gif")%>" alt="Offline" title="The page is currently offline" />
<% } %>
</td>
<td><%=Html.ActionLink(DefaultText(revision.Title, "(no title)"), "Show", new { Controller = "Templates", revision.Slug })%></td>
<td><%=Html.ActionLink(DefaultText(revision.Slug, "(no slug)"), "Show", new { Controller = "Templates", revision.Slug })%></td>
<td>By Unk</td>
<td><%=string.Format("{0:d}", revision.ModifiedDate) %><br /><%=string.Format("{0:t}", revision.ModifiedDate) %></td>
<td>
<% if (pageEntry.HasDraft) { %>
<img src="<%=ResolveUrl("~/Packages/Orchard.CmsPages/Content/Admin/images/draft.gif")%>" alt="Draft" title="The page has a draft" />
<% } %>
<% if (revision.Page.Scheduled.Any()) { %>
<img src="<%=ResolveUrl("~/Packages/Orchard.CmsPages/Content/Admin/images/scheduled.gif")%>" alt="Scheduled" title="The draft is scheduled for publishing" />
<% } %>
</td>
<td>
<%=revision.Page.Scheduled.Any() ? SplitDateTime(revision.Page.Scheduled.First().ScheduledDate.Value) : ""%>
</td>
<td><%=Html.ActionLink("Edit", "Edit", new { revision.Page.Id })%></td>
</tr>
<% pageIndex++;
<%
pageIndex++;
}%>
</table>
<p><%=Html.ActionLink("Add a page", "Create", new {}, new {@class="floatRight bottomSpacer"}) %></p>
</div>
<% Html.EndForm(); %>
</table>
</fieldset>
<p class="manage"><%=Html.ActionLink("Add a page", "Create", new {}, new { @class = "button"}) %></p>
<% } %>
<% Html.Include("Foot"); %>