mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Providing some default descriptions for out-of-the-box content parts.
--HG-- branch : 1.x extra : rebase_source : a8e36387800f484de3d5aca800b25a9f89f4982b
This commit is contained in:
@@ -31,10 +31,25 @@ namespace Orchard.Core.Common {
|
||||
.Column<DateTime>("ModifiedUtc")
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("BodyPart", builder => builder.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("CommonPart", builder => builder.Attachable());
|
||||
SchemaBuilder.CreateTable("IdentityPartRecord",
|
||||
table => table
|
||||
.ContentPartRecord()
|
||||
.Column<string>("Identifier", column => column.Unlimited())
|
||||
);
|
||||
|
||||
return 1;
|
||||
ContentDefinitionManager.AlterPartDefinition("BodyPart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Allows the editing of text using an editor provided by the configured flavor (e.g. html, text, markdown)."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("CommonPart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Provides common information about a content item, such as Owner, Date Created, Date Published and Date Modified."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Automatically generates a unique identity for the content item, which is required in import/export scenarios where one content item references another."));
|
||||
|
||||
return 3;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
@@ -47,5 +62,18 @@ namespace Orchard.Core.Common {
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
public int UpdateFrom2() {
|
||||
ContentDefinitionManager.AlterPartDefinition("BodyPart", builder => builder
|
||||
.WithDescription("Allows the editing of text using an editor provided by the configured flavor (e.g. html, text, markdown)."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("CommonPart", builder => builder
|
||||
.WithDescription("Provides common information about a content item, such as Owner, Date Created, Date Published and Date Modified."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("IdentityPart", builder => builder
|
||||
.WithDescription("Automatically generates a unique identity for the content item, which is required in import/export scenarios where one content item references another."));
|
||||
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,11 +46,19 @@ namespace Orchard.Core.Containers {
|
||||
.WithPart("ContainerWidgetPart")
|
||||
.WithSetting("Stereotype", "Widget"));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("ContainerPart", builder => builder.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("ContainablePart", builder => builder.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("CustomPropertiesPart", builder => builder.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("ContainerPart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Turns your content item into a container that is capable of containing content items that have the ContainablePart attached."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("ContainablePart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached"));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("CustomPropertiesPart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Adds 3 custom properties to your content item."));
|
||||
|
||||
return 3;
|
||||
return 4;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
@@ -69,5 +77,17 @@ namespace Orchard.Core.Containers {
|
||||
|
||||
return 3;
|
||||
}
|
||||
|
||||
public int UpdateFrom3() {
|
||||
ContentDefinitionManager.AlterPartDefinition("ContainerPart", builder => builder
|
||||
.WithDescription("Turns your content item into a container that is capable of containing content items that have the ContainablePart attached."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("ContainablePart", builder => builder
|
||||
.WithDescription("Allows your content item to be contained by a content item that has the ContainerPart attached"));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("CustomPropertiesPart", builder => builder
|
||||
.WithDescription("Adds 3 custom properties to your content item."));
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ namespace Orchard.Core.Contents.Extensions {
|
||||
return builder.WithSetting("ContentPartSettings.Attachable", attachable.ToString());
|
||||
}
|
||||
|
||||
public static ContentPartDefinitionBuilder Description(this ContentPartDefinitionBuilder builder, string description) {
|
||||
public static ContentPartDefinitionBuilder WithDescription(this ContentPartDefinitionBuilder builder, string description) {
|
||||
return builder.WithSetting("ContentPartSettings.Description", description);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,13 @@ namespace Orchard.Core.Navigation {
|
||||
public class Migrations : DataMigrationImpl {
|
||||
|
||||
public int Create() {
|
||||
ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Provides an easy way to create a ContentMenuItem from the content editor."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Allows the management of Content Menu Items associated with a Content Item."));
|
||||
ContentDefinitionManager.AlterTypeDefinition("Page", cfg => cfg.WithPart("NavigationPart"));
|
||||
|
||||
SchemaBuilder.CreateTable("MenuItemPartRecord",
|
||||
@@ -75,7 +80,9 @@ namespace Orchard.Core.Navigation {
|
||||
.WithSetting("Stereotype", "MenuItem")
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Adds a menu item to the Admin menu that links to this content item."));
|
||||
|
||||
SchemaBuilder.CreateTable("ContentMenuItemPartRecord",
|
||||
table => table
|
||||
@@ -211,5 +218,19 @@ namespace Orchard.Core.Navigation {
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
public int UpdateFrom4() {
|
||||
ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder
|
||||
.WithDescription("Provides an easy way to create a ContentMenuItem from the content editor."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder
|
||||
.WithDescription("Allows the management of Content Menu Items associated with a Content Item."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("AdminMenuPart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Adds a menu item to the Admin menu that links to this content item."));
|
||||
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,17 @@ namespace Orchard.Core.Title {
|
||||
.Column<string>("Title", column => column.WithLength(1024))
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("TitlePart", builder => builder.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("TitlePart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Provides a Title for your content item."));
|
||||
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
ContentDefinitionManager.AlterPartDefinition("TitlePart", builder => builder
|
||||
.WithDescription("Provides a Title for your content item."));
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,9 +12,17 @@ namespace Orchard.Autoroute {
|
||||
.Column<bool>("UseCustomPattern", c=> c.WithDefault(false))
|
||||
.Column<string>("DisplayAlias", c => c.WithLength(2048)));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("AutoroutePart", part => part.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("AutoroutePart", part => part
|
||||
.Attachable()
|
||||
.WithDescription("Adds advanced url configuration options to your content type to completely customize the url pattern for a content item."));
|
||||
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
ContentDefinitionManager.AlterPartDefinition("AutoroutePart", part => part
|
||||
.WithDescription("Adds advanced url configuration options to your content type to completely customize the url pattern for a content item."));
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,9 @@ namespace Orchard.Blogs {
|
||||
.Column<int>("BlogId")
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("BlogPart", builder => builder
|
||||
.WithDescription("Turns content types into a Blog."));
|
||||
|
||||
ContentDefinitionManager.AlterTypeDefinition("Blog",
|
||||
cfg => cfg
|
||||
.WithPart("BlogPart")
|
||||
@@ -49,6 +52,9 @@ namespace Orchard.Blogs {
|
||||
.WithPart("AdminMenuPart", p => p.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", "2"))
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("BlogPostPart", builder => builder
|
||||
.WithDescription("Turns content types into a BlogPost."));
|
||||
|
||||
ContentDefinitionManager.AlterTypeDefinition("BlogPost",
|
||||
cfg => cfg
|
||||
.WithPart("BlogPostPart")
|
||||
@@ -65,6 +71,9 @@ namespace Orchard.Blogs {
|
||||
.Draftable()
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("RecentBlogPostsPart", part => part
|
||||
.WithDescription("Renders a list of recent blog posts."));
|
||||
|
||||
ContentDefinitionManager.AlterTypeDefinition("RecentBlogPosts",
|
||||
cfg => cfg
|
||||
.WithPart("RecentBlogPostsPart")
|
||||
@@ -73,6 +82,9 @@ namespace Orchard.Blogs {
|
||||
.WithSetting("Stereotype", "Widget")
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("BlogArchivesPart", part => part
|
||||
.WithDescription("Renders an archive of posts for a blog."));
|
||||
|
||||
ContentDefinitionManager.AlterTypeDefinition("BlogArchives",
|
||||
cfg => cfg
|
||||
.WithPart("BlogArchivesPart")
|
||||
@@ -81,7 +93,7 @@ namespace Orchard.Blogs {
|
||||
.WithSetting("Stereotype", "Widget")
|
||||
);
|
||||
|
||||
return 5;
|
||||
return 6;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
@@ -112,5 +124,21 @@ namespace Orchard.Blogs {
|
||||
|
||||
return 5;
|
||||
}
|
||||
|
||||
public int UpdateFrom5() {
|
||||
ContentDefinitionManager.AlterPartDefinition("BlogPart", builder => builder
|
||||
.WithDescription("Turns a content type into a Blog."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("BlogPostPart", builder => builder
|
||||
.WithDescription("Turns a content type into a BlogPost."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("RecentBlogPostsPart", part => part
|
||||
.WithDescription("Renders a list of recent blog posts."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("BlogArchivesPart", part => part
|
||||
.WithDescription("Renders an archive of posts for a blog."));
|
||||
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,12 @@ namespace Orchard.Comments {
|
||||
.Column<bool>("ThreadedComments")
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("CommentPart", part => part
|
||||
.WithDescription("Used by the Comment content type."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("CommentsContainerPart", part => part
|
||||
.WithDescription("Adds support to a content type to contain comments."));
|
||||
|
||||
ContentDefinitionManager.AlterTypeDefinition("Comment",
|
||||
cfg => cfg
|
||||
.WithPart("CommentPart")
|
||||
@@ -58,9 +64,11 @@ namespace Orchard.Comments {
|
||||
.WithPart("CommentsContainerPart")
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("CommentsPart", builder => builder.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("CommentsPart", builder => builder
|
||||
.Attachable()
|
||||
.WithDescription("Allows content items to be commented on."));
|
||||
|
||||
return 4;
|
||||
return 5;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
@@ -128,5 +136,18 @@ namespace Orchard.Comments {
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
public int UpdateFrom4() {
|
||||
ContentDefinitionManager.AlterPartDefinition("CommentPart", part => part
|
||||
.WithDescription("Used by the Comment content type."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("CommentsContainerPart", part => part
|
||||
.WithDescription("Adds support to a content type to contain comments."));
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("CommentsPart", builder => builder
|
||||
.WithDescription("Allows content items to be commented on."));
|
||||
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,9 +18,18 @@ namespace Orchard.ContentPermissions {
|
||||
.Column<string>("DeleteOwnContent", c => c.Unlimited())
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("ContentPermissionsPart", p => p.Attachable());
|
||||
ContentDefinitionManager.AlterPartDefinition("ContentPermissionsPart", p => p
|
||||
.Attachable()
|
||||
.WithDescription("Provides access control configuration on a per content item level."));
|
||||
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
ContentDefinitionManager.AlterPartDefinition("ContentPermissionsPart", p => p
|
||||
.WithDescription("Provides access control configuration on a per content item level."));
|
||||
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Orchard.ContentTypes.Settings {
|
||||
var model = new ContentPartSettings();
|
||||
updateModel.TryUpdateModel(model, "ContentPartSettings", null, null);
|
||||
builder.Attachable(model.Attachable);
|
||||
builder.Description(model.Description);
|
||||
builder.WithDescription(model.Description);
|
||||
yield return DefinitionTemplate(model);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@ namespace Orchard.Widgets {
|
||||
.Column<string>("Name")
|
||||
);
|
||||
|
||||
ContentDefinitionManager.AlterPartDefinition("WidgetPart", part => part
|
||||
.Attachable()
|
||||
.WithDescription("Turns a content type into a Widget. Note: you need to set the stereotype to \"Widget\" as well."));
|
||||
|
||||
ContentDefinitionManager.AlterTypeDefinition("Layer",
|
||||
cfg => cfg
|
||||
.WithPart("LayerPart")
|
||||
@@ -39,7 +43,7 @@ namespace Orchard.Widgets {
|
||||
.WithSetting("Stereotype", "Widget")
|
||||
);
|
||||
|
||||
return 3;
|
||||
return 5;
|
||||
}
|
||||
|
||||
public int UpdateFrom1() {
|
||||
@@ -56,11 +60,16 @@ namespace Orchard.Widgets {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public int UpdateFrom3()
|
||||
{
|
||||
public int UpdateFrom3() {
|
||||
ContentDefinitionManager.AlterPartDefinition("WidgetPart", builder => builder.Attachable());
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
public int UpdateFrom4() {
|
||||
ContentDefinitionManager.AlterPartDefinition("WidgetPart", part => part
|
||||
.WithDescription("Turns a content type into a Widget. Note: you need to set the stereotype to \"Widget\" as well."));
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user