mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 13:33:34 +08:00
Changed blog admin displays (blog list and details) to use new templating methods.
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4043467
This commit is contained in:
@@ -22,31 +22,34 @@ namespace Orchard.Blogs.Controllers {
|
|||||||
private readonly IAuthorizer _authorizer;
|
private readonly IAuthorizer _authorizer;
|
||||||
private readonly INotifier _notifier;
|
private readonly INotifier _notifier;
|
||||||
private readonly IBlogService _blogService;
|
private readonly IBlogService _blogService;
|
||||||
private readonly IBlogPostService _blogPostService;
|
|
||||||
|
|
||||||
public BlogController(ISessionLocator sessionLocator, IContentManager contentManager,
|
public BlogController(ISessionLocator sessionLocator, IContentManager contentManager,
|
||||||
IAuthorizer authorizer, INotifier notifier,
|
IAuthorizer authorizer, INotifier notifier,
|
||||||
IBlogService blogService, IBlogPostService blogPostService) {
|
IBlogService blogService) {
|
||||||
_sessionLocator = sessionLocator;
|
_sessionLocator = sessionLocator;
|
||||||
_contentManager = contentManager;
|
_contentManager = contentManager;
|
||||||
_authorizer = authorizer;
|
_authorizer = authorizer;
|
||||||
_notifier = notifier;
|
_notifier = notifier;
|
||||||
_blogService = blogService;
|
_blogService = blogService;
|
||||||
_blogPostService = blogPostService;
|
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Localizer T { get; set; }
|
public Localizer T { get; set; }
|
||||||
|
|
||||||
public ActionResult List() {
|
public ActionResult List() {
|
||||||
IEnumerable<ItemDisplayViewModel<Blog>> blogs =
|
var model = new BlogsViewModel {
|
||||||
_blogService.Get().Select(b => _contentManager.GetDisplayViewModel(b, null, "Summary"));
|
Blogs = _blogService.Get().Select(b => _contentManager.GetDisplayViewModel(b, null, "Summary"))
|
||||||
|
};
|
||||||
|
|
||||||
return View(new BlogsViewModel {Blogs = blogs});
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult ListForAdmin() {
|
public ActionResult ListForAdmin() {
|
||||||
return View(new BlogsForAdminViewModel { Blogs = _blogService.Get() });
|
var model = new BlogsForAdminViewModel {
|
||||||
|
Blogs = _blogService.Get().Select(b => _contentManager.GetDisplayViewModel(b, null, "SummaryAdmin"))
|
||||||
|
};
|
||||||
|
|
||||||
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: (erikpo) Should move the slug parameter and get call and null check up into a model binder
|
//TODO: (erikpo) Should move the slug parameter and get call and null check up into a model binder
|
||||||
@@ -56,9 +59,11 @@ namespace Orchard.Blogs.Controllers {
|
|||||||
if (blog == null)
|
if (blog == null)
|
||||||
return new NotFoundResult();
|
return new NotFoundResult();
|
||||||
|
|
||||||
return View(new BlogViewModel {
|
var model = new BlogViewModel {
|
||||||
Blog = _contentManager.GetDisplayViewModel(blog, null, "Detail")
|
Blog = _contentManager.GetDisplayViewModel(blog, null, "Detail")
|
||||||
});
|
};
|
||||||
|
|
||||||
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: (erikpo) Should move the slug parameter and get call and null check up into a model binder
|
//TODO: (erikpo) Should move the slug parameter and get call and null check up into a model binder
|
||||||
@@ -68,9 +73,11 @@ namespace Orchard.Blogs.Controllers {
|
|||||||
if (blog == null)
|
if (blog == null)
|
||||||
return new NotFoundResult();
|
return new NotFoundResult();
|
||||||
|
|
||||||
IEnumerable<BlogPost> posts = _blogPostService.Get(blog);
|
var model = new BlogForAdminViewModel {
|
||||||
|
Blog = _contentManager.GetDisplayViewModel(blog, null, "DetailAdmin")
|
||||||
|
};
|
||||||
|
|
||||||
return View(new BlogForAdminViewModel { Blog = blog, Posts = posts });
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Create() {
|
public ActionResult Create() {
|
||||||
|
@@ -24,7 +24,7 @@ namespace Orchard.Blogs.Models {
|
|||||||
Filters.Add(new ActivatingFilter<RoutableAspect>("blogpost"));
|
Filters.Add(new ActivatingFilter<RoutableAspect>("blogpost"));
|
||||||
Filters.Add(new ActivatingFilter<BodyAspect>("blogpost"));
|
Filters.Add(new ActivatingFilter<BodyAspect>("blogpost"));
|
||||||
Filters.Add(new StorageFilter<BlogPostRecord>(repository));
|
Filters.Add(new StorageFilter<BlogPostRecord>(repository));
|
||||||
Filters.Add(new ContentItemTemplates<BlogPost>("BlogPost", "Detail", "Summary"));
|
Filters.Add(new ContentItemTemplates<BlogPost>("BlogPost", "Detail", "Summary", "SummaryAdmin"));
|
||||||
|
|
||||||
OnLoaded<BlogPost>((context, bp) => bp.Blog = contentManager.Get<Blog>(bp.Record.Blog.Id));
|
OnLoaded<BlogPost>((context, bp) => bp.Blog = contentManager.Get<Blog>(bp.Record.Blog.Id));
|
||||||
|
|
||||||
@@ -51,14 +51,27 @@ namespace Orchard.Blogs.Models {
|
|||||||
});
|
});
|
||||||
|
|
||||||
OnGetDisplayViewModel<Blog>((context, blog) => {
|
OnGetDisplayViewModel<Blog>((context, blog) => {
|
||||||
if (context.DisplayType != "Detail") {
|
if (!context.DisplayType.StartsWith("Detail"))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
var posts = blogPostService.Get(blog);
|
var posts = blogPostService.Get(blog);
|
||||||
var viewModels = posts.Select(
|
|
||||||
bp => contentManager.GetDisplayViewModel(bp, null, "Summary"));
|
switch(context.DisplayType) {
|
||||||
context.AddDisplay(new TemplateViewModel(viewModels) { TemplateName = "BlogPostList", ZoneName = "body" });
|
case "Detail":
|
||||||
|
context.AddDisplay(
|
||||||
|
new TemplateViewModel(posts.Select(bp => contentManager.GetDisplayViewModel(bp, null, "Summary"))) {
|
||||||
|
TemplateName = "BlogPostList",
|
||||||
|
ZoneName = "body"
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "DetailAdmin":
|
||||||
|
context.AddDisplay(
|
||||||
|
new TemplateViewModel(posts.Select(bp => contentManager.GetDisplayViewModel(bp, null, "SummaryAdmin"))) {
|
||||||
|
TemplateName = "BlogPostListAdmin",
|
||||||
|
ZoneName = "body"
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@ namespace Orchard.Blogs.Models {
|
|||||||
Filters.Add(new ActivatingFilter<CommonAspect>("blog"));
|
Filters.Add(new ActivatingFilter<CommonAspect>("blog"));
|
||||||
Filters.Add(new ActivatingFilter<RoutableAspect>("blog"));
|
Filters.Add(new ActivatingFilter<RoutableAspect>("blog"));
|
||||||
Filters.Add(new StorageFilter<BlogRecord>(repository));
|
Filters.Add(new StorageFilter<BlogRecord>(repository));
|
||||||
Filters.Add(new ContentItemTemplates<Blog>("Blog", "Detail", "Summary"));
|
Filters.Add(new ContentItemTemplates<Blog>("Blog", "Detail", "DetailAdmin", "Summary", "SummaryAdmin"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -104,10 +104,9 @@
|
|||||||
<Content Include="Views\BlogPost\Create.aspx" />
|
<Content Include="Views\BlogPost\Create.aspx" />
|
||||||
<Content Include="Views\BlogPost\Edit.aspx" />
|
<Content Include="Views\BlogPost\Edit.aspx" />
|
||||||
<Content Include="Views\BlogPost\EditorTemplates\BlogPostEditViewModel.ascx" />
|
<Content Include="Views\BlogPost\EditorTemplates\BlogPostEditViewModel.ascx" />
|
||||||
<Content Include="Views\Blog\DisplayTemplates\BlogForAdminViewModel.ascx" />
|
<Content Include="Views\Models\DisplayTemplates\BlogDetailAdmin.ascx" />
|
||||||
<Content Include="Views\Blog\ItemForAdmin.aspx" />
|
<Content Include="Views\Blog\ItemForAdmin.aspx" />
|
||||||
<Content Include="Views\Blog\DisplayTemplates\BlogsForAdminViewModel.ascx" />
|
<Content Include="Views\Models\DisplayTemplates\BlogSummaryAdmin.ascx" />
|
||||||
<Content Include="Views\Blog\DisplayTemplates\BlogForAdmin.ascx" />
|
|
||||||
<Content Include="Views\Blog\List.aspx" />
|
<Content Include="Views\Blog\List.aspx" />
|
||||||
<Content Include="Views\Blog\ListForAdmin.aspx" />
|
<Content Include="Views\Blog\ListForAdmin.aspx" />
|
||||||
<Content Include="Views\Models\DisplayTemplates\BlogPostDetail.ascx" />
|
<Content Include="Views\Models\DisplayTemplates\BlogPostDetail.ascx" />
|
||||||
@@ -123,7 +122,8 @@
|
|||||||
<Content Include="Views\Blog\EditorTemplates\BlogPermalink.ascx" />
|
<Content Include="Views\Blog\EditorTemplates\BlogPermalink.ascx" />
|
||||||
<Content Include="Views\Blog\EditorTemplates\CreateBlogViewModel.ascx" />
|
<Content Include="Views\Blog\EditorTemplates\CreateBlogViewModel.ascx" />
|
||||||
<Content Include="Views\Blog\Item.aspx" />
|
<Content Include="Views\Blog\Item.aspx" />
|
||||||
<Content Include="Views\Shared\DisplayTemplates\BlogPostPreviewForAdmin.ascx" />
|
<Content Include="Views\Models\DisplayTemplates\BlogPostSummaryAdmin.ascx" />
|
||||||
|
<Content Include="Views\Models\DisplayTemplates\BlogPostListAdmin.ascx" />
|
||||||
<Content Include="Web.config" />
|
<Content Include="Web.config" />
|
||||||
<Content Include="Views\Web.config" />
|
<Content Include="Views\Web.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@@ -1,10 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using Orchard.Blogs.Models;
|
using Orchard.Blogs.Models;
|
||||||
|
using Orchard.Models.ViewModels;
|
||||||
using Orchard.Mvc.ViewModels;
|
using Orchard.Mvc.ViewModels;
|
||||||
|
|
||||||
namespace Orchard.Blogs.ViewModels {
|
namespace Orchard.Blogs.ViewModels {
|
||||||
public class BlogForAdminViewModel : AdminViewModel {
|
public class BlogForAdminViewModel : AdminViewModel {
|
||||||
public Blog Blog { get; set; }
|
public ItemDisplayViewModel<Blog> Blog { get; set; }
|
||||||
public IEnumerable<BlogPost> Posts { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,9 +1,10 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Orchard.Blogs.Models;
|
using Orchard.Blogs.Models;
|
||||||
|
using Orchard.Models.ViewModels;
|
||||||
using Orchard.Mvc.ViewModels;
|
using Orchard.Mvc.ViewModels;
|
||||||
|
|
||||||
namespace Orchard.Blogs.ViewModels {
|
namespace Orchard.Blogs.ViewModels {
|
||||||
public class BlogsForAdminViewModel : AdminViewModel {
|
public class BlogsForAdminViewModel : AdminViewModel {
|
||||||
public IEnumerable<Blog> Blogs { get; set; }
|
public IEnumerable<ItemDisplayViewModel<Blog>> Blogs { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,21 +0,0 @@
|
|||||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Blog>" %>
|
|
||||||
<%@ Import Namespace="Orchard.Models"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
|
||||||
<h3><a href="<%=Url.BlogForAdmin(Model.Slug) %>"><%=Html.Encode(Model.Name) %></a></h3>
|
|
||||||
<div class="meta">
|
|
||||||
<% var postCount = Model.PostCount; %><a href="<%=Url.BlogForAdmin(Model.Slug) %>"><%=string.Format("{0} post{1}", postCount, postCount == 1 ? "" : "s") %></a>
|
|
||||||
| <a href="#">?? comments</a>
|
|
||||||
</div>
|
|
||||||
<%--<p>[list of authors] [modify blog access]</p>--%>
|
|
||||||
<p><%=Model.Description %></p>
|
|
||||||
<p class="actions">
|
|
||||||
<%-- todo: (heskew) make into a ul --%>
|
|
||||||
<span class="construct">
|
|
||||||
<a href="<%=Url.BlogForAdmin(Model.Slug) %>" class="ibutton blog" title="Manage Blog">Manage Blog</a>
|
|
||||||
<a href="<%=Url.BlogEdit(Model.Slug) %>" class="ibutton edit" title="Edit Blog">Edit Blog</a>
|
|
||||||
<a href="<%=Url.Blog(Model.Slug) %>" class="ibutton view" title="View Blog">View Blog</a>
|
|
||||||
<a href="<%=Url.BlogPostCreate(Model.Slug) %>" class="ibutton add page" title="New Post">New Post</a>
|
|
||||||
</span>
|
|
||||||
<span class="destruct"><a href="<%=Url.BlogDelete(Model.Slug) %>" class="ibutton remove" title="Delete Blog">Remove Blog</a></span>
|
|
||||||
</p>
|
|
@@ -1,13 +0,0 @@
|
|||||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogsForAdminViewModel>" %>
|
|
||||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.ViewModels"
|
|
||||||
%><%
|
|
||||||
if (Model.Blogs.Count() > 0) { %>
|
|
||||||
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>">New Blog</a></div>
|
|
||||||
<%=Html.UnorderedList(Model.Blogs, (b, i) => Html.DisplayFor(blog => b, "BlogForAdmin").ToHtmlString(), "contentItems") %>
|
|
||||||
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>">New Blog</a></div><%
|
|
||||||
} else { %>
|
|
||||||
<div class="info message">There are no blogs for you to see. Want to <a href="<%=Url.BlogCreate() %>">add one</a>?</div><%
|
|
||||||
} %>
|
|
@@ -1,11 +1,6 @@
|
|||||||
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BlogForAdminViewModel>" %>
|
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BlogForAdminViewModel>" %>
|
||||||
<%@ Import Namespace="Orchard.Core.Common.Models"%>
|
|
||||||
<%@ Import Namespace="Orchard.Models"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
|
||||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
|
||||||
<% Html.Include("AdminHead"); %>
|
<% Html.Include("AdminHead"); %>
|
||||||
<%=Html.DisplayForModel() %>
|
<%=Html.DisplayForItem(m => m.Blog) %>
|
||||||
<% Html.Include("AdminFoot"); %>
|
<% Html.Include("AdminFoot"); %>
|
@@ -5,6 +5,12 @@
|
|||||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||||
<% Html.Include("AdminHead"); %>
|
<% Html.Include("AdminHead"); %>
|
||||||
<h2>Manage Blogs</h2>
|
<h2>Manage Blogs</h2>
|
||||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p><%
|
||||||
<%=Html.DisplayForModel() %>
|
if (Model.Blogs.Count() > 0) { %>
|
||||||
|
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>">New Blog</a></div>
|
||||||
|
<%=Html.UnorderedList(Model.Blogs, (b, i) => Html.DisplayForItem(b).ToHtmlString(), "blogs contentItems") %>
|
||||||
|
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>">New Blog</a></div><%
|
||||||
|
} else { %>
|
||||||
|
<div class="info message">There are no blogs for you to see. Want to <a href="<%=Url.BlogCreate() %>">add one</a>?</div><%
|
||||||
|
} %>
|
||||||
<% Html.Include("AdminFoot"); %>
|
<% Html.Include("AdminFoot"); %>
|
@@ -1,18 +1,22 @@
|
|||||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogForAdminViewModel>" %>
|
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ItemDisplayViewModel<Blog>>" %>
|
||||||
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||||
<%@ Import Namespace="Orchard.Blogs.ViewModels"%>
|
<%@ Import Namespace="Orchard.Models.ViewModels"%>
|
||||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||||
<%-- todo: (heskew) get what actions we can out of the h2 :| --%>
|
<%-- todo: (heskew) get what actions we can out of the h2 :| --%>
|
||||||
<h2 class="withActions">
|
<h2 class="withActions">
|
||||||
<a href="<%=Url.BlogForAdmin(Model.Blog.Slug) %>"><%=Html.Encode(Model.Blog.Name) %></a>
|
<a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>"><%=Html.Encode(Model.Item.Name) %></a>
|
||||||
<a href="<%=Url.BlogEdit(Model.Blog.Slug) %>" class="ibutton edit" title="Edit Blog">Edit Blog</a>
|
<a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit" title="Edit Blog">Edit Blog</a>
|
||||||
<span class="actions"><span class="destruct"><a href="<%=Url.BlogDelete(Model.Blog.Slug) %>" class="ibutton remove" title="Remove Blog">Remove Blog</a></span></span></h2>
|
<span class="actions"><span class="destruct"><a href="<%=Url.BlogDelete(Model.Item.Slug) %>" class="ibutton remove" title="Remove Blog">Remove Blog</a></span></span></h2>
|
||||||
<p><%=Model.Blog.Description %></p><%
|
<p><%=Model.Item.Description%></p>
|
||||||
|
<div class="actions"><a href="<%=Url.BlogPostCreate(Model.Item.Slug) %>" class="add button">New Post</a></div>
|
||||||
|
<%--TODO: (erikpo) Need to figure out which zones should be displayed in this template--%>
|
||||||
|
<%=Html.DisplayZonesAny() %>
|
||||||
|
|
||||||
|
<%--<%
|
||||||
if (Model.Posts.Count() > 0) { %>
|
if (Model.Posts.Count() > 0) { %>
|
||||||
<div class="actions"><a href="<%=Url.BlogPostCreate(Model.Blog.Slug) %>" class="add button">New Post</a></div>
|
|
||||||
<%=Html.UnorderedList(Model.Posts, (p, i) => Html.DisplayFor(blog => p, "BlogPostPreviewForAdmin").ToHtmlString(), "contentItems")%>
|
<%=Html.UnorderedList(Model.Posts, (p, i) => Html.DisplayFor(blog => p, "BlogPostPreviewForAdmin").ToHtmlString(), "contentItems")%>
|
||||||
<div class="actions"><a href="<%=Url.BlogPostCreate(Model.Blog.Slug) %>" class="add button">New Post</a></div><%
|
<div class="actions"><a href="<%=Url.BlogPostCreate(Model.Blog.Slug) %>" class="add button">New Post</a></div><%
|
||||||
} else { %>
|
} else { %>
|
||||||
<div class="info message">This blog is sad with no posts, but don't fret. You can add a new post right <a href="<%=Url.BlogPostCreate(Model.Blog.Slug) %>">here</a>!</div><%
|
<div class="info message">This blog is sad with no posts, but don't fret. You can add a new post right <a href="<%=Url.BlogPostCreate(Model.Blog.Slug) %>">here</a>!</div><%
|
||||||
} %>
|
} %>--%>
|
@@ -0,0 +1,5 @@
|
|||||||
|
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<ItemDisplayViewModel<BlogPost>>>" %>
|
||||||
|
<%@ Import Namespace="Orchard.Mvc.Html"%>
|
||||||
|
<%@ Import Namespace="Orchard.Models.ViewModels"%>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||||
|
<%=Html.UnorderedList(Model, (bp, i) => Html.DisplayForItem(bp).ToHtmlString(), "blogPosts contentItems") %>
|
@@ -0,0 +1,21 @@
|
|||||||
|
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ItemDisplayViewModel<BlogPost>>" %>
|
||||||
|
<%@ Import Namespace="Orchard.Models.ViewModels"%>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||||
|
<h3><a href="<%=Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Slug) %>"><%=Html.Encode(Model.Item.Title)%></a></h3>
|
||||||
|
<div class="meta">
|
||||||
|
<%=Html.PublishedState(Model.Item) %>
|
||||||
|
| <a href="#">?? comments</a>
|
||||||
|
</div>
|
||||||
|
<div class="content"><%=Model.Item.Body ?? "<p><em>there's no content for this blog post</em></p>"%></div>
|
||||||
|
<p class="actions">
|
||||||
|
<%-- todo: (heskew) make into a ul --%>
|
||||||
|
<span class="construct">
|
||||||
|
<a href="<%=Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton edit" title="Edit Post">Edit Post</a>
|
||||||
|
<a href="<%=Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton view" title="View Post">View Post</a><%
|
||||||
|
if (Model.Item.Published == null) { // todo: (heskew) be smart about this and maybe have other contextual actions - including view/preview for view up there ^^ %>
|
||||||
|
<a href="<%=Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug) %>" class="ibutton publish" title="Publish Post Now">Publish Post Now</a>
|
||||||
|
<% } %>
|
||||||
|
</span>
|
||||||
|
<span class="destruct"><a href="#" class="ibutton remove" title="Remove Post">Remove Post</a></span>
|
||||||
|
</p>
|
@@ -0,0 +1,21 @@
|
|||||||
|
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ItemDisplayViewModel<Blog>>" %>
|
||||||
|
<%@ Import Namespace="Orchard.Models.ViewModels"%>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||||
|
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||||
|
<h3><a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>"><%=Html.Encode(Model.Item.Name) %></a></h3>
|
||||||
|
<div class="meta">
|
||||||
|
<% var postCount = Model.Item.PostCount; %><a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>"><%=string.Format("{0} post{1}", postCount, postCount == 1 ? "" : "s") %></a>
|
||||||
|
| <a href="#">?? comments</a>
|
||||||
|
</div>
|
||||||
|
<%--<p>[list of authors] [modify blog access]</p>--%>
|
||||||
|
<p><%=Model.Item.Description %></p>
|
||||||
|
<p class="actions">
|
||||||
|
<%-- todo: (heskew) make into a ul --%>
|
||||||
|
<span class="construct">
|
||||||
|
<a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>" class="ibutton blog" title="Manage Blog">Manage Blog</a>
|
||||||
|
<a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit" title="Edit Blog">Edit Blog</a>
|
||||||
|
<a href="<%=Url.Blog(Model.Item.Slug) %>" class="ibutton view" title="View Blog">View Blog</a>
|
||||||
|
<a href="<%=Url.BlogPostCreate(Model.Item.Slug) %>" class="ibutton add page" title="New Post">New Post</a>
|
||||||
|
</span>
|
||||||
|
<span class="destruct"><a href="<%=Url.BlogDelete(Model.Item.Slug) %>" class="ibutton remove" title="Delete Blog">Remove Blog</a></span>
|
||||||
|
</p>
|
@@ -1,22 +0,0 @@
|
|||||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BlogPost>" %>
|
|
||||||
<%@ Import Namespace="Orchard.Models"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
|
||||||
<%@ Import Namespace="Orchard.Core.Common.Models"%>
|
|
||||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
|
||||||
<h3><a href="<%=Url.BlogPostEdit(Model.Blog.Slug, Model.Slug) %>"><%=Html.Encode(Model.Title) %></a></h3>
|
|
||||||
<div class="meta">
|
|
||||||
<%=Html.PublishedState() %>
|
|
||||||
| <a href="#">?? comments</a>
|
|
||||||
</div>
|
|
||||||
<div class="content"><%=Model.Body ?? "<p><em>there's no content for this blog post</em></p>" %></div>
|
|
||||||
<p class="actions">
|
|
||||||
<%-- todo: (heskew) make into a ul --%>
|
|
||||||
<span class="construct">
|
|
||||||
<a href="<%=Url.BlogPostEdit(Model.Blog.Slug, Model.Slug) %>" class="ibutton edit" title="Edit Post">Edit Post</a>
|
|
||||||
<a href="<%=Url.BlogPost(Model.Blog.Slug, Model.Slug) %>" class="ibutton view" title="View Post">View Post</a><%
|
|
||||||
if (Model.Published == null) { // todo: (heskew) be smart about this and maybe have other contextual actions - including view/preview for view up there ^^ %>
|
|
||||||
<a href="<%=Url.BlogPost(Model.Blog.Slug, Model.Slug) %>" class="ibutton publish" title="Publish Post Now">Publish Post Now</a>
|
|
||||||
<% } %>
|
|
||||||
</span>
|
|
||||||
<span class="destruct"><a href="#" class="ibutton remove" title="Remove Post">Remove Post</a></span>
|
|
||||||
</p>
|
|
Reference in New Issue
Block a user