Updating the blogs admin to show unpublished blogs to fix the publish/unpublish workflow

work item: 16763

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-24 00:44:50 -08:00
parent 224870c869
commit f8823e3831
4 changed files with 7 additions and 3 deletions

View File

@@ -135,7 +135,7 @@ namespace Orchard.Blogs.Controllers {
public ActionResult List() {
var list = Services.New.List();
list.AddRange(_blogService.Get()
list.AddRange(_blogService.Get(VersionOptions.Latest)
.Select(b => {
var blog = Services.ContentManager.BuildDisplay(b, "SummaryAdmin");
blog.TotalPostCount = _blogPostService.Get(b, VersionOptions.Latest).Count();

View File

@@ -29,7 +29,11 @@ namespace Orchard.Blogs.Services {
}
public IEnumerable<BlogPart> Get() {
return _contentManager.Query<BlogPart, BlogPartRecord>()
return Get(VersionOptions.Published);
}
public IEnumerable<BlogPart> Get(VersionOptions versionOptions) {
return _contentManager.Query<BlogPart, BlogPartRecord>(versionOptions)
.Join<RoutePartRecord>()
.OrderBy(br => br.Title)
.List();

View File

@@ -7,6 +7,7 @@ namespace Orchard.Blogs.Services {
BlogPart Get(string slug);
ContentItem Get(int id, VersionOptions versionOptions);
IEnumerable<BlogPart> Get();
IEnumerable<BlogPart> Get(VersionOptions versionOptions);
void Delete(ContentItem blog);
}
}

View File

@@ -21,7 +21,6 @@
</div>
<div class="related">
@Display(Model.Actions)
<a href="@Url.Blog(blog)" title="@T("View")">@T("View")</a>@T(" | ")
<a href="@Url.BlogForAdmin(blog)" title="@T("List Posts")">@T("List Posts")</a>@T(" | ")
<a href="@Url.BlogPostCreate(blog)" title="@T("New Post")">@T("New Post")</a>@T(" | ")
<a href="@Url.BlogEdit(blog)" title="@T("Edit")">@T("Edit")</a>@T(" | ")