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-06-08 23:42:20 -07:00
|
|
|
<h1><%: Html.TitleForPage(T("Manage Blogs").ToString()) %></h1>
|
|
|
|
<%-- todo: Add helper text here when ready. <p><%: T("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-06-10 23:39:49 -07:00
|
|
|
<div class="actions"><a class="add button primaryAction" href="<%: Url.BlogCreate() %>"><%: T("New Blog") %></a></div>
|
|
|
|
<%: Html.UnorderedList(Model.Entries, (entry, i) => {
|
2010-01-21 07:27:47 +00:00
|
|
|
// 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-06-09 15:39:35 -07:00
|
|
|
|
|
|
|
var linkText = T.Plural("1 post", "{0} posts", totalPostCount).ToString();
|
2010-07-14 22:49:50 -07:00
|
|
|
if (draftCount > 0){
|
2010-06-09 15:39:35 -07:00
|
|
|
linkText = linkText + " (" + T.Plural("1 draft", "{0} drafts", draftCount).ToString() + ")";
|
|
|
|
}
|
2010-01-22 02:06:07 +00:00
|
|
|
|
2010-06-09 15:39:35 -07:00
|
|
|
html.ViewContext.Writer.Write(html.Link(linkText, Url.BlogForAdmin(entry.ContentItemViewModel.Item.Slug)));
|
2010-01-21 07:27:47 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// Display the summary for the blog post
|
2010-06-18 13:44:02 -07:00
|
|
|
return Html.DisplayForItem(entry.ContentItemViewModel);
|
2010-03-09 17:08:37 -08:00
|
|
|
}, "blogs contentItems")%><%
|
2009-12-17 10:29:33 +00:00
|
|
|
} else { %>
|
2010-06-09 15:39:35 -07:00
|
|
|
<div class="info message"><%:T("There are no blogs for you to see. Want to <a href=\"{0}\">add one</a>?", Url.BlogCreate())%></div><%
|
2009-12-17 10:29:33 +00:00
|
|
|
} %>
|