--HG--
branch : dev
This commit is contained in:
Suha Can
2011-02-10 16:07:51 -08:00
32 changed files with 81 additions and 24 deletions

View File

@@ -8,6 +8,7 @@ using Orchard.Core.Feeds;
using Orchard.Core.Routable.Services;
using Orchard.DisplayManagement;
using Orchard.Logging;
using Orchard.Mvc;
using Orchard.Services;
using Orchard.Themes;
using Orchard.UI.Navigation;
@@ -92,8 +93,7 @@ namespace Orchard.Blogs.Controllers {
var totalItemCount = _blogPostService.PostCount(blogPart);
blog.Content.Add(Shape.Pager(pager).TotalItemCount(totalItemCount), "Content:after");
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)blog);
return new ShapeResult(this, blog);
}
}
}

View File

@@ -7,6 +7,7 @@ using Orchard.ContentManagement;
using Orchard.Core.Feeds;
using Orchard.DisplayManagement;
using Orchard.Localization;
using Orchard.Mvc;
using Orchard.Security;
using Orchard.Themes;
@@ -51,8 +52,7 @@ namespace Orchard.Blogs.Controllers {
return HttpNotFound();
dynamic model = _services.ContentManager.BuildDisplay(postPart);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
return View((object)model);
return new ShapeResult(this, model);
}
public ActionResult ListByArchive(string blogPath, string archiveData) {

View File

@@ -115,9 +115,7 @@
<Content Include="Views\BlogAdmin\List.cshtml" />
<Content Include="Views\BlogPostAdmin\Create.cshtml" />
<Content Include="Views\BlogPostAdmin\Edit.cshtml" />
<Content Include="Views\BlogPost\Item.cshtml" />
<Content Include="Views\BlogPost\ListByArchive.cshtml" />
<Content Include="Views\Blog\Item.cshtml" />
<Content Include="Views\Blog\List.cshtml" />
<Content Include="Views\Parts.Blogs.Blog.Manage.cshtml" />
<Content Include="Views\Parts.Blogs.Blog.Description.cshtml" />

View File

@@ -1 +0,0 @@
@Display(Model)

View File

@@ -1,5 +1,6 @@
<h1>@Html.TitleForPage(T("Create New Blog").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}

View File

@@ -1,5 +1,6 @@
<h1>@Html.TitleForPage(T("Blog Properties").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}

View File

@@ -1,4 +1,5 @@
@{
Html.AddTitleParts(T("Manage Blog").ToString());
}
@Display(Model)
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)

View File

@@ -1 +0,0 @@
@Display(Model)

View File

@@ -1,5 +1,6 @@
<h1>@Html.TitleForPage(T("Create New Blog Post").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}

View File

@@ -1,5 +1,6 @@
<h1>@Html.TitleForPage(T("Edit Blog Post").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}

View File

@@ -0,0 +1,17 @@
<Placement>
<!-- Customize where the shapes are rendered -->
<!--
<Place Parts_Blogs_BlogArchives="Content:before"/>
<Place Parts_Blogs_RecentBlogPosts="Content:after"/>
<Match ContentType="Blog">
<Match DisplayType="Summary">
<Place Parts_Blogs_Blog_Description="Content:before"
Parts_Blogs_Blog_BlogPostCount="Meta:3"/>
</Match>
</Match>
<Match Path="/About">
<Place Parts_Common_Metadata="-"/>
</Match>
-->
</Placement>

View File

@@ -312,6 +312,9 @@ namespace Orchard.CodeGeneration.Commands {
File.WriteAllBytes(themePath + "Theme.png", File.ReadAllBytes(_codeGenTemplatePath + "Theme.png"));
createdFiles.Add(themePath + "Theme.png");
File.WriteAllText(themePath + "Placement.info", File.ReadAllText(_codeGenTemplatePath + "Placement.info"));
createdFiles.Add(themePath + "Placement.info");
// create new csproj for the theme
if (projectGuid != null) {
var itemGroup = CreateProjectItemGroup(themePath, createdFiles, createdFolders);

View File

@@ -79,6 +79,9 @@
<ItemGroup>
<Content Include="CodeGenerationTemplates\ModuleRootWebConfig.txt" />
</ItemGroup>
<ItemGroup>
<Content Include="CodeGenerationTemplates\Placement.info" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -66,7 +66,7 @@ namespace Orchard.Users.Controllers {
users = users.Where(u => u.RegistrationStatus == UserStatus.Pending);
break;
case UsersFilter.EmailPending:
users = users.Where(u => u.EmailStatus == UserStatus.Approved);
users = users.Where(u => u.EmailStatus == UserStatus.Pending);
break;
}

View File

@@ -1,5 +1,6 @@
<h1>@Html.TitleForPage(T("Add User").ToString()) </h1>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}

View File

@@ -1,5 +1,6 @@
<h1>@Html.TitleForPage(T("Edit User").ToString()) </h1>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}

View File

@@ -1,5 +1,6 @@
<h1>@Html.TitleForPage(T("Add Layer").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}

View File

@@ -1,5 +1,6 @@
<h1>@Html.TitleForPage(T("Add Widget").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}

View File

@@ -1,5 +1,6 @@
<h1>@Html.TitleForPage(T("Edit Layer").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}

View File

@@ -1,5 +1,6 @@
<h1>@Html.TitleForPage(T("Edit Widget").ToString())</h1>
@using (Html.BeginFormAntiForgeryPost()) {
@using (Html.BeginFormAntiForgeryPost()) {
@Html.ValidationSummary()
// Model is a Shape, calling Display() so that it is rendered using the most specific template for its Shape type
@Display(Model)
}