mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 21:43:37 +08:00
Hooking up some links to make creating blog posts easier (temp UI).
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4042149
This commit is contained in:
@@ -10,10 +10,10 @@ using Orchard.Localization;
|
||||
using Orchard.Models;
|
||||
using Orchard.Models.Driver;
|
||||
using Orchard.Mvc.Results;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Notify;
|
||||
|
||||
namespace Orchard.Blogs.Controllers {
|
||||
[ValidateInput(false)]
|
||||
public class BlogController : Controller, IUpdateModel {
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly INotifier _notifier;
|
||||
|
@@ -9,6 +9,7 @@ using Orchard.Models;
|
||||
using Orchard.Mvc.Results;
|
||||
|
||||
namespace Orchard.Blogs.Controllers {
|
||||
[ValidateInput(false)]
|
||||
public class BlogPostController : Controller {
|
||||
private readonly ISessionLocator _sessionLocator;
|
||||
private readonly IBlogService _blogService;
|
||||
|
@@ -10,6 +10,10 @@ namespace Orchard.Blogs.Extensions {
|
||||
return urlHelper.Action("Item", "Blog", new {blogSlug, area = "Orchard.Blogs"});
|
||||
}
|
||||
|
||||
public static string BlogCreate(this UrlHelper urlHelper) {
|
||||
return urlHelper.Action("Create", "Blog", new {area = "Orchard.Blogs"});
|
||||
}
|
||||
|
||||
public static string BlogEdit(this UrlHelper urlHelper, string blogSlug) {
|
||||
return urlHelper.Action("Edit", "Blog", new {blogSlug, area = "Orchard.Blogs"});
|
||||
}
|
||||
@@ -18,6 +22,10 @@ namespace Orchard.Blogs.Extensions {
|
||||
return urlHelper.Action("Item", "BlogPost", new {blogSlug, postSlug, area = "Orchard.Blogs"});
|
||||
}
|
||||
|
||||
public static string BlogPostCreate(this UrlHelper urlHelper, string blogSlug) {
|
||||
return urlHelper.Action("Create", "BlogPost", new {blogSlug, area = "Orchard.Blogs"});
|
||||
}
|
||||
|
||||
public static string BlogPostEdit(this UrlHelper urlHelper, string blogSlug, string postSlug) {
|
||||
return urlHelper.Action("Edit", "BlogPost", new {blogSlug, postSlug, area = "Orchard.Blogs"});
|
||||
}
|
||||
|
@@ -2,16 +2,16 @@
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.ViewModels"
|
||||
%><p>[add blog]</p><%
|
||||
%><p><a href="<%=Url.BlogCreate() %>">Create a New Blog</a></p><%
|
||||
if (Model.Blogs.Count() > 0) { %>
|
||||
<ul><%
|
||||
foreach (Blog blog in Model.Blogs) { %>
|
||||
<li>
|
||||
<h3><a href="<%=Url.BlogEdit(blog.Slug) %>"><%=Html.Encode(blog.Name) %></a> <span>(<a href="<%=Url.Blog(blog.Slug) %>">view</a>)</span></h3>
|
||||
<h3><a href="<%=Url.BlogEdit(blog.Slug) %>"><%=Html.Encode(blog.Name) %></a> <span>(<a href="<%=Url.Blog(blog.Slug) %>">view</a>)</span> <span>(<a href="<%=Url.BlogPostCreate(blog.Slug) %>">post</a>)</span></h3>
|
||||
<p>[list of authors] [modify blog access]</p>
|
||||
<p><%=blog.Description %></p>
|
||||
</li><%
|
||||
} %>
|
||||
</ul>
|
||||
<p>[add blog]</p><%
|
||||
<p><a href="<%=Url.BlogCreate() %>">Create a New Blog</a></p><%
|
||||
} %>
|
Reference in New Issue
Block a user