Changing parts shapes to use the "Parts_" prefix convention.

Similart to content items now (Items_*) and what fields will use (Fields_*)

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-10-11 09:45:29 -07:00
parent ddca57edd4
commit 71ead6bae3
50 changed files with 57 additions and 55 deletions

View File

@@ -35,7 +35,7 @@ namespace Orchard.Core.Common.Drivers {
protected override DriverResult Display(BodyPart part, string displayType, dynamic shapeHelper) {
var bodyText = _htmlFilters.Aggregate(part.Text, (text, filter) => filter.ProcessContent(text));
var body = shapeHelper.Common_Body(ContentPart: part, Html: new HtmlString(bodyText));
var body = shapeHelper.Parts_Common_Body(ContentPart: part, Html: new HtmlString(bodyText));
if (!string.IsNullOrWhiteSpace(displayType))
body.Metadata.Type = string.Format("{0}.{1}", body.Metadata.Type, displayType);
var location = part.GetLocation(displayType);

View File

@@ -36,7 +36,7 @@ namespace Orchard.Core.Common.Drivers {
public IOrchardServices Services { get; set; }
protected override DriverResult Display(CommonPart part, string displayType, dynamic shapeHelper) {
var metadata = shapeHelper.Common_Metadata(ContentPart: part);
var metadata = shapeHelper.Parts_Common_Metadata(ContentPart: part);
if (!string.IsNullOrWhiteSpace(displayType))
metadata.Metadata.Type = string.Format("{0}.{1}", metadata.Metadata.Type, displayType);
var location = part.GetLocation(displayType);

View File

@@ -5,7 +5,7 @@ using Orchard.Core.ContentsLocation.Models;
namespace Orchard.Core.Contents.Drivers {
public class ContentsDriver : ContentPartDriver<ContentPart> {
protected override DriverResult Display(ContentPart part, string displayType, dynamic shapeHelper) {
var publish = shapeHelper.Contents_Publish(ContentPart: part);
var publish = shapeHelper.Parts_Contents_Publish(ContentPart: part);
if (!string.IsNullOrWhiteSpace(displayType))
publish.Metadata.Type = string.Format("{0}.{1}", publish.Metadata.Type, displayType);
var location = part.GetLocation(displayType, "Secondary", "5");

View File

@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Web;
using JetBrains.Annotations;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
@@ -23,7 +22,7 @@ namespace Orchard.Core.Localization.Drivers {
}
protected override DriverResult Display(LocalizationPart part, string displayType, dynamic shapeHelper) {
var contentTranslations = shapeHelper.Localization_ContentTranslations(ContentPart: part, Localizations: GetDisplayLocalizations(part));
var contentTranslations = shapeHelper.Parts_Localization_ContentTranslations(ContentPart: part, Localizations: GetDisplayLocalizations(part));
if (!string.IsNullOrWhiteSpace(displayType))
contentTranslations.Metadata.Type = string.Format("{0}.{1}", contentTranslations.Metadata.Type, displayType);
var location = part.GetLocation(displayType);

View File

@@ -254,12 +254,12 @@
<Content Include="Common\Views\DefinitionTemplates\BodyTypePartSettings.cshtml" />
<Content Include="Common\Views\DefinitionTemplates\BodyPartSettings.cshtml" />
<Content Include="Common\Views\DisplayTemplates\Fields\Common.TextField.cshtml" />
<Content Include="Common\Views\Common.Body.SummaryAdmin.cshtml" />
<Content Include="Common\Views\Parts\Common.Body.SummaryAdmin.cshtml" />
<Content Include="Common\Views\DisplayTemplates\Parts\Common.Body.Manage.SummaryAdmin.cshtml" />
<Content Include="Common\Views\DisplayTemplates\Parts\Common.Body.ManageWrapperPost.SummaryAdmin.cshtml" />
<Content Include="Common\Views\DisplayTemplates\Parts\Common.Body.ManageWrapperPre.SummaryAdmin.cshtml" />
<Content Include="Common\Views\Common.Metadata.cshtml" />
<Content Include="Common\Views\Common.Metadata.SummaryAdmin.cshtml" />
<Content Include="Common\Views\Parts\Common.Metadata.cshtml" />
<Content Include="Common\Views\Parts\Common.Metadata.SummaryAdmin.cshtml" />
<Content Include="ContentsLocation\Module.txt" />
<Content Include="ContentsLocation\Styles\admin.css" />
<Content Include="ContentsLocation\Views\DefinitionTemplates\LocationSettings.cshtml" />
@@ -268,8 +268,8 @@
<Content Include="Contents\Views\Admin\List.cshtml" />
<Content Include="Feeds\Views\Feed.cshtml" />
<Content Include="Localization\Views\EditorTemplates\Parts\Localization.Translation.cshtml" />
<Content Include="Contents\Views\Contents.Publish.cshtml" />
<Content Include="Contents\Views\Contents.Publish.SummaryAdmin.cshtml" />
<Content Include="Contents\Views\Parts\Contents.Publish.cshtml" />
<Content Include="Contents\Views\Parts\Contents.Publish.SummaryAdmin.cshtml" />
<Content Include="Messaging\Module.txt" />
<Content Include="Messaging\Views\EditorTemplates\Parts\Messaging.MessageSettings.cshtml" />
<Content Include="PublishLater\Content\Admin\images\draft.gif" />
@@ -277,8 +277,8 @@
<Content Include="PublishLater\Content\Admin\images\online.gif" />
<Content Include="PublishLater\Content\Admin\images\published.gif" />
<Content Include="PublishLater\Content\Admin\images\scheduled.gif" />
<Content Include="PublishLater\Views\PublishLater.Metadata.cshtml" />
<Content Include="PublishLater\Views\PublishLater.Metadata.SummaryAdmin.cshtml" />
<Content Include="PublishLater\Views\Parts\PublishLater.Metadata.cshtml" />
<Content Include="PublishLater\Views\Parts\PublishLater.Metadata.SummaryAdmin.cshtml" />
<Content Include="Common\Views\EditorTemplates\Fields\Common.TextField.cshtml" />
<Content Include="Common\Views\EditorTemplates\Parts\Common.Container.cshtml" />
<Content Include="Common\Views\EditorTemplates\PlainTextEditor.cshtml" />
@@ -286,8 +286,8 @@
<Content Include="Contents\Views\Admin\CreatableTypeList.cshtml" />
<Content Include="Localization\Styles\admin.css" />
<Content Include="Localization\Styles\base.css" />
<Content Include="Localization\Views\Localization.ContentTranslations.Summary.cshtml" />
<Content Include="Localization\Views\Localization.ContentTranslations.cshtml" />
<Content Include="Localization\Views\Parts\Localization.ContentTranslations.Summary.cshtml" />
<Content Include="Localization\Views\Parts\Localization.ContentTranslations.cshtml" />
<Content Include="PublishLater\Module.txt" />
<Content Include="PublishLater\Styles\datetime.css" />
<Content Include="PublishLater\Views\EditorTemplates\Parts\PublishLater.cshtml" />
@@ -296,7 +296,7 @@
<Content Include="Reports\Views\Admin\Index.cshtml" />
<Content Include="Localization\Module.txt" />
<Content Include="Localization\Views\Admin\Translate.cshtml" />
<Content Include="Localization\Views\Localization.ContentTranslations.SummaryAdmin.cshtml" />
<Content Include="Localization\Views\Parts\Localization.ContentTranslations.SummaryAdmin.cshtml" />
<Content Include="Localization\Views\CultureSelection.cshtml" />
<Content Include="Routable\Module.txt" />
<Content Include="Routable\Scripts\jquery.slugify.js" />
@@ -345,7 +345,7 @@
<Content Include="Common\Views\Web.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Common\Views\Common.Body.cshtml" />
<Content Include="Common\Views\Parts\Common.Body.cshtml" />
<Content Include="Common\Views\EditorTemplates\Parts\Common.Body.cshtml" />
<Content Include="Common\Views\EditorTemplates\Parts\Common.Owner.cshtml" />
<Content Include="Feeds\Module.txt" />
@@ -361,7 +361,7 @@
<Content Include="Navigation\Views\Web.config" />
</ItemGroup>
<ItemGroup>
<Content Include="Common\Views\Common.Body.Summary.cshtml" />
<Content Include="Common\Views\Parts\Common.Body.Summary.cshtml" />
<Content Include="Common\Views\DisplayTemplates\Parts\Common.Body.ManageWrapperPost.cshtml" />
<Content Include="Common\Views\DisplayTemplates\Parts\Common.Body.ManageWrapperPre.cshtml" />
<Content Include="Common\Views\DisplayTemplates\Parts\Common.Body.Manage.cshtml" />
@@ -390,7 +390,7 @@
<Content Include="Shapes\Views\MenuItem.cshtml" />
<Content Include="Shapes\Views\Web.config" />
<Content Include="Dashboard\Views\Helper\Index.cshtml" />
<Content Include="Routable\Views\Routable.RoutePart.cshtml" />
<Content Include="Routable\Views\Parts\Routable.RoutePart.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

View File

@@ -28,7 +28,7 @@ namespace Orchard.Core.PublishLater.Drivers {
public IOrchardServices Services { get; set; }
protected override DriverResult Display(PublishLaterPart part, string displayType, dynamic shapeHelper) {
var metadata = shapeHelper.PublishLater_Metadata(ContentPart: part, ScheduledPublishUtc: part.ScheduledPublishUtc.Value);
var metadata = shapeHelper.Parts_PublishLater_Metadata(ContentPart: part, ScheduledPublishUtc: part.ScheduledPublishUtc.Value);
if (!string.IsNullOrWhiteSpace(displayType))
metadata.Metadata.Type = string.Format("{0}.{1}", metadata.Metadata.Type, displayType);
var location = part.GetLocation(displayType);

View File

@@ -45,7 +45,7 @@ namespace Orchard.Core.Routable.Drivers {
}
protected override DriverResult Display(RoutePart part, string displayType, dynamic shapeHelper) {
var routePart = shapeHelper.Routable_RoutePart(ContentPart: part, Title: part.Title);
var routePart = shapeHelper.Parts_Routable_RoutePart(ContentPart: part, Title: part.Title);
if (!string.IsNullOrWhiteSpace(displayType))
routePart.Metadata.Type = string.Format("{0}.{1}", routePart.Metadata.Type, displayType);
var location = part.GetLocation(displayType, "Header", "5");

View File

@@ -29,7 +29,7 @@ namespace ArchiveLater.Drivers {
public IOrchardServices Services { get; set; }
protected override DriverResult Display(ArchiveLaterPart part, string displayType, dynamic shapeHelper) {
var metadata = shapeHelper.ArchiveLater_Metadata(ContentPart: part, ScheduledArchiveUtc: part.ScheduledArchiveUtc.Value);
var metadata = shapeHelper.Parts_ArchiveLater_Metadata(ContentPart: part, ScheduledArchiveUtc: part.ScheduledArchiveUtc.Value);
if (!string.IsNullOrWhiteSpace(displayType))
metadata.Metadata.Type = string.Format("{0}.{1}", metadata.Metadata.Type, displayType);
var location = part.GetLocation(displayType);

View File

@@ -98,8 +98,8 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Views\ArchiveLater.Metadata.cshtml" />
<Content Include="Views\ArchiveLater.Metadata.SummaryAdmin.cshtml" />
<Content Include="Views\Parts\ArchiveLater.Metadata.cshtml" />
<Content Include="Views\Parts\ArchiveLater.Metadata.SummaryAdmin.cshtml" />
<Content Include="Views\EditorTemplates\Parts\ArchiveLater.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

View File

@@ -37,20 +37,20 @@ namespace Orchard.Blogs.Drivers {
protected override DriverResult Display(BlogPart part, string displayType, dynamic shapeHelper) {
var driverResults = new List<DriverResult>();
var metadata = shapeHelper.Blogs_Blog_Manage(ContentPart: part);
metadata.Metadata.Type = "Blogs_Blog.Manage";
var metadata = shapeHelper.Parts_Blogs_Blog_Manage(ContentPart: part);
metadata.Metadata.Type = "Parts_Blogs_Blog.Manage";
driverResults.Add(ContentShape(metadata).Location("manage"));
var description = shapeHelper.Blogs_Blog_Description(ContentPart: part);
description.Metadata.Type = "Blogs_Blog.Description";
var description = shapeHelper.Parts_Blogs_Blog_Description(ContentPart: part);
description.Metadata.Type = "Parts_Blogs_Blog.Description";
driverResults.Add(ContentShape(description).Location("manage", "after"));
if (displayType.StartsWith("Admin")) {
var list = shapeHelper.List();
list.AddRange(_blogPostService.Get(part, VersionOptions.Latest)
.Select(bp => _contentManager.BuildDisplay(bp, "SummaryAdmin.BlogPost")));
var blogPostList = shapeHelper.Blogs_BlogPost_List(ContentPart: part, BlogPosts: list);
blogPostList.Metadata.Type = "Blogs_BlogPost.List.Admin";
var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, BlogPosts: list);
blogPostList.Metadata.Type = "Parts_Blogs_BlogPost.List.Admin";
var contentShape = ContentShape(blogPostList).Location("primary");
driverResults.Add(contentShape);
}
@@ -58,8 +58,8 @@ namespace Orchard.Blogs.Drivers {
var list = shapeHelper.List();
list.AddRange(_blogPostService.Get(part)
.Select(bp => _contentManager.BuildDisplay(bp, "Summary.BlogPost")));
var blogPostList = shapeHelper.Blogs_BlogPost_List(ContentPart: part, BlogPosts: list);
blogPostList.Metadata.Type = "Blogs_BlogPost.List";
var blogPostList = shapeHelper.Parts_Blogs_BlogPost_List(ContentPart: part, BlogPosts: list);
blogPostList.Metadata.Type = "Parts_Blogs_BlogPost.List";
var contentShape = ContentShape(blogPostList).Location("primary");
driverResults.Add(contentShape);

View File

@@ -122,12 +122,12 @@
<Content Include="Views\BlogPost\ListByArchive.cshtml" />
<Content Include="Views\Blog\Item.cshtml" />
<Content Include="Views\Blog\List.cshtml" />
<Content Include="Views\Blogs.Blog.Manage.cshtml" />
<Content Include="Views\Blogs.Blog.Description.cshtml" />
<Content Include="Views\Common.Metadata.Admin.Blog.cshtml" />
<Content Include="Views\Blogs.BlogPost.List.cshtml" />
<Content Include="Views\Parts\Blogs.Blog.Manage.cshtml" />
<Content Include="Views\Parts\Blogs.Blog.Description.cshtml" />
<Content Include="Views\Parts\Common.Metadata.Admin.Blog.cshtml" />
<Content Include="Views\Parts\Blogs.BlogPost.List.cshtml" />
<Content Include="Views\EditorTemplates\Parts\Blogs.Blog.Fields.cshtml" />
<Content Include="Views\Blogs.BlogPost.List.Admin.cshtml">
<Content Include="Views\Parts\Blogs.BlogPost.List.Admin.cshtml">
<SubType>Code</SubType>
</Content>
<Content Include="Views\Items\Content.Admin.Blog.cshtml" />
@@ -155,31 +155,31 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Views\Common.Metadata.Blog.cshtml" />
<Content Include="Views\Parts\Common.Metadata.Blog.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Localization.ContentTranslations.Summary.BlogPost.cshtml" />
<Content Include="Views\Parts\Localization.ContentTranslations.Summary.BlogPost.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Common.Body.Summary.BlogPost.cshtml" />
<Content Include="Views\Parts\Common.Body.Summary.BlogPost.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Tags.ShowTags.Summary.BlogPost.cshtml" />
<Content Include="Views\Parts\Tags.ShowTags.Summary.BlogPost.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\PublishLater.Metadata.BlogPost.cshtml" />
<Content Include="Views\Parts\PublishLater.Metadata.BlogPost.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Common.Metadata.BlogPost.cshtml" />
<Content Include="Views\Parts\Common.Metadata.BlogPost.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Localization.ContentTranslations.BlogPost.cshtml" />
<Content Include="Views\Parts\Localization.ContentTranslations.BlogPost.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Common.Body.BlogPost.cshtml" />
<Content Include="Views\Parts\Common.Body.BlogPost.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Tags.ShowTags.BlogPost.cshtml" />
<Content Include="Views\Parts\Tags.ShowTags.BlogPost.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

View File

@@ -20,9 +20,9 @@ namespace Orchard.Comments.Drivers {
int pendingCount = parts.Aggregate(0, (seed, item) => seed + (item.Has<CommentsPart>() ? item.As<CommentsPart>().PendingComments.Count : 0));
if (displayType == "SummaryAdmin")
return ContentShape(shapeHelper.Comments_CountAdmin(ContentPart: part, CommentCount: count, PendingCount: pendingCount)).Location(part.GetLocation("SummaryAdmin"));
return ContentShape(shapeHelper.Parts_Comments_CountAdmin(ContentPart: part, CommentCount: count, PendingCount: pendingCount)).Location(part.GetLocation("SummaryAdmin"));
return ContentShape(shapeHelper.Comments_Count(ContentPart: part, CommentCount: count, PendingCount: pendingCount)).Location(part.GetLocation("Summary"));
return ContentShape(shapeHelper.Parts_Comments_Count(ContentPart: part, CommentCount: count, PendingCount: pendingCount)).Location(part.GetLocation("Summary"));
}
return null;

View File

@@ -12,17 +12,17 @@ namespace Orchard.Comments.Drivers {
return null;
if (displayType.StartsWith("Detail"))
return ContentShape(shapeHelper.Comments_Comments(ContentPart: part)).Location(part.GetLocation("Detail"));
return ContentShape(shapeHelper.Parts_Comments_Comments(ContentPart: part)).Location(part.GetLocation("Detail"));
if (displayType == "SummaryAdmin")
return ContentShape(shapeHelper.Comments_CountAdmin(ContentPart: part, CommentCount: part.Comments.Count, PendingCount: part.PendingComments.Count))
return ContentShape(shapeHelper.Parts_Comments_CountAdmin(ContentPart: part, CommentCount: part.Comments.Count, PendingCount: part.PendingComments.Count))
.Location(part.GetLocation("SummaryAdmin"));
var location = displayType.Contains("Summary")
? part.GetLocation("Summary")
: part.GetLocation(displayType);
return ContentShape(shapeHelper.Comments_Count(ContentPart: part, CommentCount: part.Comments.Count, PendingCount: part.PendingComments.Count))
return ContentShape(shapeHelper.Parts_Comments_Count(ContentPart: part, CommentCount: part.Comments.Count, PendingCount: part.PendingComments.Count))
.Location(location);
}

View File

@@ -127,9 +127,9 @@
<Content Include="Views\Admin\Details.cshtml" />
<Content Include="Views\Admin\Edit.cshtml" />
<Content Include="Views\Admin\Index.cshtml" />
<Content Include="Views\Comments.Comments.cshtml" />
<Content Include="Views\Comments.Count.cshtml" />
<Content Include="Views\Comments.CountAdmin.cshtml" />
<Content Include="Views\Parts\Comments.Comments.cshtml" />
<Content Include="Views\Parts\Comments.Count.cshtml" />
<Content Include="Views\Parts\Comments.CountAdmin.cshtml" />
<Content Include="Views\EditorTemplates\Parts\Comments.Comments.cshtml" />
<Content Include="Views\EditorTemplates\Parts\Comments.SiteSettings.cshtml" />
<Content Include="Views\ListOfComments.cshtml" />

View File

@@ -24,7 +24,7 @@ namespace Orchard.Tags.Drivers {
public virtual IUser CurrentUser { get; set; }
protected override DriverResult Display(TagsPart part, string displayType, dynamic shapeHelper) {
var showTags = shapeHelper.Tags_ShowTags(ContentPart: part, Tags: part.CurrentTags);
var showTags = shapeHelper.Parts_Tags_ShowTags(ContentPart: part, Tags: part.CurrentTags);
if (!string.IsNullOrWhiteSpace(displayType))
showTags.Metadata.Type = string.Format("{0}.{1}", showTags.Metadata.Type, displayType);
var location = part.GetLocation(displayType);

View File

@@ -97,7 +97,7 @@
<Content Include="Views\Admin\Edit.cshtml" />
<Content Include="Views\Admin\Index.cshtml" />
<Content Include="Views\Admin\Search.cshtml" />
<Content Include="Views\Tags.ShowTags.cshtml" />
<Content Include="Views\Parts\Tags.ShowTags.cshtml" />
<Content Include="Views\EditorTemplates\Parts\Tags.EditTags.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
<Content Include="Views\Home\Search.cshtml" />

View File

@@ -40,4 +40,7 @@
<div id="footer" role="contentinfo">
@Display(Model.Footer)</div>
@* tmp *@
<div style="background:#666;color:#daf2f6;margin:10px;padding:10px;font:12px/18px Consolas,'Lucida Console','Bitstream Vera Sans Mono','DejaVu Sans Mono',monospace;">
@Display.DumpShapeTable()
</div>