--HG--
branch : dev
This commit is contained in:
jowall
2010-03-01 16:47:04 -08:00
25 changed files with 82 additions and 70 deletions

View File

@@ -81,6 +81,9 @@ namespace Orchard.Blogs.Controllers {
return Combined( return Combined(
ContentItemTemplate("Items/Blogs.Blog").LongestMatch(displayType, "Summary", "DetailAdmin", "SummaryAdmin"), ContentItemTemplate("Items/Blogs.Blog").LongestMatch(displayType, "Summary", "DetailAdmin", "SummaryAdmin"),
ContentPartTemplate(blog, "Parts/Blogs.Blog.Manage").Location("primary:manage"),
ContentPartTemplate(blog, "Parts/Blogs.Blog.Metadata").Location("primary:metadata"),
ContentPartTemplate(blog, "Parts/Blogs.Blog.Description").Location("primary"),
blogPosts == null ? null : ContentPartTemplate(blogPosts, "Parts/Blogs.BlogPost.List", "").Location("primary")); blogPosts == null ? null : ContentPartTemplate(blogPosts, "Parts/Blogs.BlogPost.List", "").Location("primary"));
} }

View File

@@ -64,7 +64,10 @@ namespace Orchard.Blogs.Controllers {
} }
protected override DriverResult Display(BlogPost post, string displayType) { protected override DriverResult Display(BlogPost post, string displayType) {
return ContentItemTemplate("Items/Blogs.BlogPost").LongestMatch(displayType, "Summary", "SummaryAdmin"); return Combined(
ContentItemTemplate("Items/Blogs.BlogPost").LongestMatch(displayType, "Summary", "SummaryAdmin"),
ContentPartTemplate(post, "Parts/Blogs.BlogPost.Manage").Location("primary:manage"),
ContentPartTemplate(post, "Parts/Blogs.BlogPost.Metadata").Location("primary:metadata"));
} }
protected override DriverResult Editor(BlogPost post) { protected override DriverResult Editor(BlogPost post) {

View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}</ProjectGuid> <ProjectGuid>{63FBD4D9-E1DA-4A7B-AA6A-D6074FE50867}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
@@ -155,6 +155,11 @@
<Content Include="Views\DisplayTemplates\Items\Blogs.Blog.ascx" /> <Content Include="Views\DisplayTemplates\Items\Blogs.Blog.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" /> <Content Include="Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
<Content Include="Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" /> <Content Include="Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.BlogPost.Manage.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.BlogPost.Metadata.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.Blog.Manage.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.Blog.Description.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Blogs.Blog.Metadata.ascx" />
<Content Include="Views\EditorTemplates\Parts\Blogs.BlogPost.Publish.ascx" /> <Content Include="Views\EditorTemplates\Parts\Blogs.BlogPost.Publish.ascx" />
<Content Include="Views\BlogPost\Item.ascx" /> <Content Include="Views\BlogPost\Item.ascx" />
<Content Include="Views\BlogAdmin\Create.ascx" /> <Content Include="Views\BlogAdmin\Create.ascx" />
@@ -201,6 +206,9 @@
<IISUrl> <IISUrl>
</IISUrl> </IISUrl>
<NTLMAuthentication>False</NTLMAuthentication> <NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties> </WebProjectProperties>
</FlavorProperties> </FlavorProperties>

View File

@@ -1,10 +1,6 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %> <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%> <%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%> <%@ Import Namespace="Orchard.Blogs.Models"%>
<%-- todo: (heskew) selectively display to those who have access --%>
<h1><%=Html.TitleForPage(Model.Item.Name) %></h1> <h1><%=Html.TitleForPage(Model.Item.Name) %></h1>
<div class="manage"><a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit"><%=_Encoded("edit") %></a></div> <% Html.Zone("primary", ":manage :metadata");
<p><%=Html.Encode(Model.Item.Description) %></p>
<% Html.Zone("primary");
Html.ZonesAny(); %> Html.ZonesAny(); %>

View File

@@ -1,13 +1,6 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %> <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%> <%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%> <%@ Import Namespace="Orchard.Blogs.Models"%>
<h1><%=Html.TitleForPage(Model.Item.Title)%></h1> <h1><%=Html.TitleForPage(Model.Item.Title)%></h1>
<div class="manage"><a href="<%=Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Id) %>" class="ibutton edit"><%=_Encoded("Edit") %></a></div> <% Html.Zone("primary", ":manage :metadata");
<div class="metadata">
<% if (Model.Item.Creator != null) {
%><div class="posted"><%=_Encoded("Posted by {0} {1}", Model.Item.Creator.UserName, Html.PublishedWhen(Model.Item)) %></div><%
} %>
</div>
<% Html.Zone("primary");
Html.ZonesAny(); %> Html.ZonesAny(); %>

View File

@@ -0,0 +1,5 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Blog>" %>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<div class="blogdescription">
<p><%=Html.Encode(Model.Description) %></p>
</div>

View File

@@ -0,0 +1,6 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Blog>" %>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<div class="manage">
<a href="<%=Url.BlogEdit(Model.Slug) %>" class="edit"><%=_Encoded("Edit") %></a>
</div>

View File

@@ -0,0 +1,2 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Blog>" %>
<%@ Import Namespace="Orchard.Blogs.Models"%>

View File

@@ -0,0 +1,6 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BlogPost>" %>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<div class="manage">
<a href="<%=Url.BlogPostEdit(Model.Blog.Slug, Model.Id) %>" class="edit"><%=_Encoded("Edit") %></a>
</div>

View File

@@ -0,0 +1,8 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BlogPost>" %>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<div class="metadata"><%
if (Model.Creator != null) {
%><div class="posted"><%=_Encoded("Posted by {0} {1}", Model.Creator.UserName, Html.PublishedWhen(Model)) %></div><%
} %>
</div>

View File

@@ -132,6 +132,7 @@ namespace Orchard.Pages.Controllers {
} }
Services.ContentManager.Create(model.Page.Item.ContentItem, VersionOptions.Draft); Services.ContentManager.Create(model.Page.Item.ContentItem, VersionOptions.Draft);
Services.ContentManager.UpdateEditorModel(page, this);
// Execute publish command // Execute publish command
switch (Request.Form["Command"]) { switch (Request.Form["Command"]) {

View File

@@ -60,7 +60,10 @@ namespace Orchard.Pages.Controllers {
} }
protected override DriverResult Display(Page page, string displayType) { protected override DriverResult Display(Page page, string displayType) {
return ContentItemTemplate("Items/Pages.Page").LongestMatch(displayType, "Summary", "SummaryAdmin"); return Combined(
ContentItemTemplate("Items/Pages.Page").LongestMatch(displayType, "Summary", "SummaryAdmin"),
ContentPartTemplate(page, "Parts/Pages.Page.Manage").Location("primary:manage"),
ContentPartTemplate(page, "Parts/Pages.Page.Metadata").Location("primary:metadata"));
} }
protected override DriverResult Editor(Page page) { protected override DriverResult Editor(Page page) {

View File

@@ -119,6 +119,8 @@
<Content Include="Styles\ui.timepickr.css" /> <Content Include="Styles\ui.timepickr.css" />
<Content Include="Views\DisplayTemplates\Items\Pages.Page.ascx" /> <Content Include="Views\DisplayTemplates\Items\Pages.Page.ascx" />
<Content Include="Views\DisplayTemplates\Items\Pages.Page.Summary.ascx" /> <Content Include="Views\DisplayTemplates\Items\Pages.Page.Summary.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Pages.Page.Metadata.ascx" />
<Content Include="Views\DisplayTemplates\Parts\Pages.Page.Manage.ascx" />
<Content Include="Views\EditorTemplates\Items\Pages.Page.ascx" /> <Content Include="Views\EditorTemplates\Items\Pages.Page.ascx" />
<Content Include="Views\EditorTemplates\Parts\Pages.Page.Publish.ascx" /> <Content Include="Views\EditorTemplates\Parts\Pages.Page.Publish.ascx" />
<Content Include="Views\Admin\Create.ascx" /> <Content Include="Views\Admin\Create.ascx" />

View File

@@ -1,10 +1,6 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Orchard.Pages.Models.Page>>" %> <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Orchard.Pages.Models.Page>>" %>
<%@ Import Namespace="Orchard.Mvc.Html"%> <%@ Import Namespace="Orchard.Mvc.Html"%>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%> <%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<div class="manage"><a href="<%=Url.Action(T("Edit").ToString(), "Admin", new {id = Model.Item.Id, area = "Orchard.Pages"}) %>" class="ibutton edit"><%=_Encoded("edit")%></a></div>
<h1><%=Html.TitleForPage(Model.Item.Title)%></h1> <h1><%=Html.TitleForPage(Model.Item.Title)%></h1>
<div class="metadata"> <% Html.Zone("primary", ":manage :metadata");
<div class="posted">Published by <%=Model.Item.Creator != null ? Html.Encode(Model.Item.Creator.UserName) : _Encoded("nobody(?)").ToString()%></div>
</div>
<% Html.Zone("primary");
Html.ZonesAny(); %> Html.ZonesAny(); %>

View File

@@ -0,0 +1,6 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Pages.Models.Page>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Mvc.Html" %>
<div class="manage">
<a href="<%=Url.Action("Edit", "Admin", new {id = Model.Id, area = "Orchard.Pages"}) %>" class="edit"><%=_Encoded("Edit")%></a>
</div>

View File

@@ -0,0 +1,5 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.Pages.Models.Page>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<div class="metadata">
<div class="posted"><%=_Encoded("Published by {0}", Model.Creator != null ? Model.Creator.UserName : T("nobody(?)"))%></div>
</div>

View File

@@ -1,4 +1,4 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PageViewModel>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PageViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.Html"%> <%@ Import Namespace="Orchard.Mvc.Html"%>
<%@ Import Namespace="Orchard.Pages.ViewModels"%> <%@ Import Namespace="Orchard.Pages.ViewModels"%>
<%=Html.DisplayForItem(m=>m.Page) %> <%=Html.DisplayForItem(m=>m.Page) %>

View File

@@ -103,7 +103,7 @@ namespace Orchard.Setup.Controllers {
// create home page as a CMS page // create home page as a CMS page
var page = contentManager.Create("page"); var page = contentManager.Create("page");
page.As<BodyAspect>().Text = "<p>Welcome to Orchard!</p><p>Congratulations, you've successfully set-up your Orchard site.</p><p>This is the home page of your new site. We've taken the liberty to write here about a few things you could look at next in order to get familiar with the application. Once you feel confident you don't need this anymore, just click [Edit] to go into edit mode and replace this with whatever you want on your home page to make it your own.</p><p>One thing you could do (but you don't have to) is go into [Manage Settings] (follow the [Admin] link and then look for it under \"Settings\" in the menu on the left) and check that everything is configured the way you want.</p><p>You probably want to make the site your own. One of the ways you can do that is by clicking [Manage Themes] in the admin menu. A theme is a packaged look and feel that affects the whole site. We have installed a few themes already, but you'll also be able to browse through an online gallery of themes created by other users of Orchard.</p><p>Next, you can start playing with the content types that we installed. For example, go ahead and click [Add New Page] in the admin menu and create an \"about\" page. Then, add it to the navigation menu by going to [Manage Navigation]. You can also click [Add New Blog] and start posting by clicking [Add New Post].</p><p>Finally, Orchard has been designed to be extended. It comes with a few built-in modules such as pages and blogs but you can install new ones by going to [Manage Themes] and clicking [Install a new Theme]. Like for themes, modules are created by other users of Orchard just like you so if you feel up to it, please [consider participating].</p><p>--The Orchard Crew</p>"; page.As<BodyAspect>().Text = "<p>Welcome to Orchard!</p><p>Congratulations, you've successfully set-up your Orchard site.</p><p>This is the home page of your new site. We've taken the liberty to write here about a few things you could look at next in order to get familiar with the application. Once you feel confident you don't need this anymore, just click <a href=\"Admin/Pages/Edit/3\">Edit</a> to go into edit mode and replace this with whatever you want on your home page to make it your own.</p><p>One thing you could do (but you don't have to) is go into <a href=\"Admin/Settings\">Manage Settings</a> (follow the <a href=\"Admin\">Admin</a> link and then look for it under \"Settings\" in the menu on the left) and check that everything is configured the way you want.</p><p>You probably want to make the site your own. One of the ways you can do that is by clicking <a href=\"Admin/Themes\">Manage Themes</a> in the admin menu. A theme is a packaged look and feel that affects the whole site. We have installed a few themes already, but you'll also be able to browse through an online gallery of themes created by other users of Orchard.</p><p>Next, you can start playing with the content types that we installed. For example, go ahead and click <a href=\"Admin/Pages/Create\">Add New Page</a> in the admin menu and create an \"about\" page. Then, add it to the navigation menu by going to <a href=\"Admin/Navigation\">Manage Menu</a>. You can also click <a href=\"Admin/Blogs/Create\">Add New Blog</a> and start posting by clicking \"Add New Post\".</p><p>Finally, Orchard has been designed to be extended. It comes with a few built-in modules such as pages and blogs or themes. You can install new themes by going to <a href=\"Admin/Themes\">Manage Themes</a> and clicking <a href=\"Admin/Themes/Install\">Install a new Theme</a>. Like for themes, modules are created by other users of Orchard just like you so if you feel up to it, please <a href=\"http://www.orchardproject.net/\">consider participating</a>.</p><p>--The Orchard Crew</p>";
page.As<RoutableAspect>().Slug = "home"; page.As<RoutableAspect>().Slug = "home";
page.As<RoutableAspect>().Title = T("Home").ToString(); page.As<RoutableAspect>().Title = T("Home").ToString();
page.As<HasComments>().CommentsShown = false; page.As<HasComments>().CommentsShown = false;

View File

@@ -174,7 +174,6 @@
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" /> <Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.BlogPost.ascx" /> <Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.BlogPost.ascx" />
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" /> <Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Pages.Page.ascx" />
<Content Include="Themes\Classic\Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" /> <Content Include="Themes\Classic\Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
<Content Include="Themes\Classic\Views\Footer.ascx" /> <Content Include="Themes\Classic\Views\Footer.ascx" />
<Content Include="Themes\Classic\Views\Layout.ascx" /> <Content Include="Themes\Classic\Views\Layout.ascx" />
@@ -196,7 +195,6 @@
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.Blog.ascx" /> <Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.Blog.ascx" />
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" /> <Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" /> <Content Include="Themes\Green\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
<Content Include="Themes\Green\Views\DisplayTemplates\Items\Pages.Page.ascx" />
<Content Include="Themes\Green\Views\Footer.ascx" /> <Content Include="Themes\Green\Views\Footer.ascx" />
<Content Include="Themes\Green\Views\Layout.ascx" /> <Content Include="Themes\Green\Views\Layout.ascx" />
<Content Include="Themes\Green\Views\ListOfComments.ascx" /> <Content Include="Themes\Green\Views\ListOfComments.ascx" />

View File

@@ -3,7 +3,5 @@
<%@ Import Namespace="Orchard.Blogs.Extensions"%> <%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%> <%@ Import Namespace="Orchard.Blogs.Models"%>
<h2><%=Html.TitleForPage(Model.Item.Name) %></h2> <h2><%=Html.TitleForPage(Model.Item.Name) %></h2>
<div class="manage"><a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit"><%=_Encoded("Edit") %></a></div> <% Html.Zone("primary", ":manage :metadata");
<div class="blogdescription"><p><%=Html.Encode(Model.Item.Description) %></p></div>
<% Html.Zone("primary");
Html.ZonesAny(); %> Html.ZonesAny(); %>

View File

@@ -1,12 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Orchard.Pages.Models.Page>>" %>
<%@ Import Namespace="Orchard.Mvc.Html"%>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<h1><%=Html.TitleForPage(Model.Item.Title)%></h1>
<div class="manage"><a href="<%=Url.Action(T("Edit").ToString(), "Admin", new {id = Model.Item.Id, area = "Orchard.Pages"}) %>" class="ibutton edit"><%=_Encoded("Edit")%></a></div>
<div class="metadata">
<div class="posted">Published by <%=Model.Item.Creator != null ? Html.Encode(Model.Item.Creator.UserName) : _Encoded("nobody(?)").ToString()%></div>
</div>
<% Html.Zone("primary");
Html.ZonesAny(); %>

View File

@@ -1,20 +1,8 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %> <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Blog>>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%> <%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%> <%@ Import Namespace="Orchard.Blogs.Models"%>
<div class="bloginfo"> <div class="bloginfo">
<h1><%=Html.TitleForPage(Model.Item.Name) %></h1> <h1><%=Html.TitleForPage(Model.Item.Name) %></h1>
<div class="manage">
<a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit"><%=_Encoded("Edit") %></a>
</div>
<div class="blogdescription">
<p><%=Html.Encode(Model.Item.Description) %></p>
</div>
</div> </div>
<% Html.Zone("primary", ":manage :metadata");
<% Html.Zone("primary"); Html.ZonesAny(); %>
Html.ZonesAny(); %>

View File

@@ -1,12 +0,0 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<Orchard.Pages.Models.Page>>" %>
<%@ Import Namespace="Orchard.Mvc.Html"%>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<h1><%=Html.TitleForPage(Model.Item.Title)%></h1>
<div class="manage"><a href="<%=Url.Action(T("Edit").ToString(), "Admin", new {id = Model.Item.Id, area = "Orchard.Pages"}) %>" class="ibutton edit"><%=_Encoded("Edit")%></a></div>
<div class="metadata">
<div class="posted">Published by <%=Model.Item.Creator != null ? Html.Encode(Model.Item.Creator.UserName) : _Encoded("nobody(?)").ToString()%></div>
</div>
<% Html.Zone("primary");
Html.ZonesAny(); %>

View File

@@ -166,15 +166,25 @@ namespace Orchard.ContentManagement {
/* Display and editor convenience extension methods */ /* Display and editor convenience extension methods */
public static ContentItemViewModel<T> BuildDisplayModel<T>(this IContentManager manager, int id, string displayType) where T : class, IContent { public static ContentItemViewModel<T> BuildDisplayModel<T>(this IContentManager manager, int id, string displayType) where T : class, IContent {
return manager.BuildDisplayModel(manager.Get<T>(id), displayType); var content = manager.Get<T>(id);
if (content == null)
return null;
return manager.BuildDisplayModel(content, displayType);
} }
public static ContentItemViewModel<T> BuildEditorModel<T>(this IContentManager manager, int id) where T : class, IContent { public static ContentItemViewModel<T> BuildEditorModel<T>(this IContentManager manager, int id) where T : class, IContent {
return manager.BuildEditorModel(manager.Get<T>(id)); var content = manager.Get<T>(id);
if (content == null)
return null;
return manager.BuildEditorModel(content);
} }
public static ContentItemViewModel<T> UpdateEditorModel<T>(this IContentManager manager, int id, IUpdateModel updater) where T : class, IContent { public static ContentItemViewModel<T> UpdateEditorModel<T>(this IContentManager manager, int id, IUpdateModel updater) where T : class, IContent {
return manager.UpdateEditorModel(manager.Get<T>(id), updater); var content = manager.Get<T>(id);
if (content == null)
return null;
return manager.UpdateEditorModel(content, updater);
} }

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Web.Mvc; using System.Web.Mvc;
using System.Web.Mvc.Html; using System.Web.Mvc.Html;
using System.Web.Routing; using System.Web.Routing;