2010-01-07 00:12:56 +00:00
|
|
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<AdminBlogsViewModel>" %>
|
2009-12-17 10:29:33 +00:00
|
|
|
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
|
|
|
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
|
2010-01-07 00:12:56 +00:00
|
|
|
<h1><%=Html.TitleForPage(T("Manage Blogs").ToString()) %></h1>
|
2010-01-20 20:52:00 +00:00
|
|
|
<%-- todo: Add helper text here when ready. <p><%=_Encoded("Possible text about setting up and managing a blog goes here.") %></p> --%><%
|
2010-01-21 07:27:47 +00:00
|
|
|
if (Model.Entries.Count() > 0) { %>
|
2010-01-07 00:12:56 +00:00
|
|
|
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>"><%=_Encoded("New Blog") %></a></div>
|
2010-01-21 07:27:47 +00:00
|
|
|
<%=Html.UnorderedList(Model.Entries, (entry, i) => {
|
|
|
|
// Add blog post count rendering into "meta" zone
|
|
|
|
entry.ContentItemViewModel.Zones.AddAction("meta", html => {
|
|
|
|
int draftCount = entry.TotalPostCount - entry.ContentItemViewModel.Item.PostCount;
|
2010-01-22 02:06:07 +00:00
|
|
|
int totalPostCount = entry.TotalPostCount;
|
2010-01-21 07:27:47 +00:00
|
|
|
var draftText = (draftCount == 0 ? "": string.Format(" ({0} draft{1})", draftCount, draftCount == 1 ? "" : "s"));
|
2010-01-22 02:06:07 +00:00
|
|
|
|
|
|
|
var linkContent = _Encoded("{0} post{1}{2}", totalPostCount, totalPostCount == 1 ? "" : "s", draftText);
|
|
|
|
|
2010-01-21 07:27:47 +00:00
|
|
|
html.ViewContext.Writer.Write(html.Link(linkContent.ToString(), Url.BlogForAdmin(entry.ContentItemViewModel.Item.Slug)));
|
|
|
|
});
|
|
|
|
|
|
|
|
// Display the summary for the blog post
|
|
|
|
return Html.DisplayForItem(entry.ContentItemViewModel).ToHtmlString();
|
|
|
|
}, "blogs contentItems")%>
|
2010-01-07 00:12:56 +00:00
|
|
|
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>"><%=_Encoded("New Blog") %></a></div><%
|
2009-12-17 10:29:33 +00:00
|
|
|
} else { %>
|
2010-01-07 08:48:31 +00:00
|
|
|
<div class="info message"><%=T("There are no blogs for you to see. Want to <a href=\"{0}\">add one</a>?", Url.BlogCreate()).ToString()%></div><%
|
2009-12-17 10:29:33 +00:00
|
|
|
} %>
|