mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 13:33:34 +08:00
Changed (front end) blogs list page to use new templating methods.
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043457
This commit is contained in:
@@ -39,7 +39,10 @@ namespace Orchard.Blogs.Controllers {
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public ActionResult List() {
|
||||
return View(new BlogsViewModel { Blogs = _blogService.Get() });
|
||||
IEnumerable<ItemDisplayViewModel<Blog>> blogs =
|
||||
_blogService.Get().Select(b => _contentManager.GetDisplayViewModel(b, null, "Summary"));
|
||||
|
||||
return View(new BlogsViewModel {Blogs = blogs});
|
||||
}
|
||||
|
||||
public ActionResult ListForAdmin() {
|
||||
@@ -50,12 +53,9 @@ namespace Orchard.Blogs.Controllers {
|
||||
public ActionResult Item(string blogSlug) {
|
||||
Blog blog = _blogService.Get(blogSlug);
|
||||
|
||||
|
||||
if (blog == null)
|
||||
return new NotFoundResult();
|
||||
|
||||
// var posts = _blogPostService.Get(blog).Select(bp => _contentManager.GetDisplayViewModel(bp, null, "Summary"));
|
||||
|
||||
return View(new BlogViewModel {
|
||||
Blog = _contentManager.GetDisplayViewModel(blog, null, "Detail")
|
||||
});
|
||||
|
Reference in New Issue
Block a user