mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Some naming and text changes
- make name of implicit part on type to hold type fields not lower-cased\ - give type's a more friendly default display name --HG-- branch : dev
This commit is contained in:
@@ -223,7 +223,7 @@ namespace Orchard.ContentTypes.Services {
|
|||||||
if (name.Length > 128)
|
if (name.Length > 128)
|
||||||
name = name.Substring(0, 128);
|
name = name.Substring(0, 128);
|
||||||
|
|
||||||
return name.ToLowerInvariant();
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string VersionName(string name) {
|
private static string VersionName(string name) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentTypes.ViewModels.AddFieldViewModel>" %>
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentTypes.ViewModels.AddFieldViewModel>" %>
|
||||||
<%
|
<%
|
||||||
Html.RegisterStyle("admin.css"); %>
|
Html.RegisterStyle("admin.css"); %>
|
||||||
<h1><%:Html.TitleForPage(T("Add a new field to \"{0}\"", Model.Part.DisplayName).ToString())%></h1><%
|
<h1><%:Html.TitleForPage(T("Add New Field To \"{0}\"", Model.Part.DisplayName).ToString())%></h1><%
|
||||||
using (Html.BeginFormAntiForgeryPost()) { %>
|
using (Html.BeginFormAntiForgeryPost()) { %>
|
||||||
<%:Html.ValidationSummary() %>
|
<%:Html.ValidationSummary() %>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentTypes.ViewModels.AddPartsViewModel>" %>
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentTypes.ViewModels.AddPartsViewModel>" %>
|
||||||
<%
|
<%
|
||||||
Html.RegisterStyle("admin.css"); %>
|
Html.RegisterStyle("admin.css"); %>
|
||||||
<h1><%:Html.TitleForPage(T("Add parts to \"{0}\"", Model.Type.DisplayName).ToString())%></h1><%
|
<h1><%:Html.TitleForPage(T("Add Parts To \"{0}\"", Model.Type.DisplayName).ToString())%></h1><%
|
||||||
using (Html.BeginFormAntiForgeryPost()) { %>
|
using (Html.BeginFormAntiForgeryPost()) { %>
|
||||||
<%:Html.ValidationSummary() %>
|
<%:Html.ValidationSummary() %>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
@@ -192,13 +192,11 @@ namespace Orchard.Setup.Services {
|
|||||||
|
|
||||||
var contentDefinitionManager = environment.Resolve<IContentDefinitionManager>();
|
var contentDefinitionManager = environment.Resolve<IContentDefinitionManager>();
|
||||||
contentDefinitionManager.AlterTypeDefinition("BlogPost", cfg => cfg
|
contentDefinitionManager.AlterTypeDefinition("BlogPost", cfg => cfg
|
||||||
.DisplayedAs("Blog Post")
|
|
||||||
.WithPart("CommentsPart")
|
.WithPart("CommentsPart")
|
||||||
.WithPart("TagsPart")
|
.WithPart("TagsPart")
|
||||||
.WithPart("LocalizationPart")
|
.WithPart("LocalizationPart")
|
||||||
.Indexed());
|
.Indexed());
|
||||||
contentDefinitionManager.AlterTypeDefinition("Page", cfg => cfg
|
contentDefinitionManager.AlterTypeDefinition("Page", cfg => cfg
|
||||||
.DisplayedAs("Page")
|
|
||||||
.WithPart("CommonPart")
|
.WithPart("CommonPart")
|
||||||
.WithPart("PublishLaterPart")
|
.WithPart("PublishLaterPart")
|
||||||
.WithPart("RoutePart")
|
.WithPart("RoutePart")
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Orchard.ContentManagement.MetaData.Builders;
|
using Orchard.ContentManagement.MetaData.Builders;
|
||||||
using Orchard.ContentManagement.MetaData.Models;
|
using Orchard.ContentManagement.MetaData.Models;
|
||||||
|
using Orchard.Utility.Extensions;
|
||||||
|
|
||||||
namespace Orchard.ContentManagement.MetaData {
|
namespace Orchard.ContentManagement.MetaData {
|
||||||
public interface IContentDefinitionManager : IDependency {
|
public interface IContentDefinitionManager : IDependency {
|
||||||
@@ -18,7 +19,7 @@ namespace Orchard.ContentManagement.MetaData {
|
|||||||
|
|
||||||
public static class ContentDefinitionManagerExtensions{
|
public static class ContentDefinitionManagerExtensions{
|
||||||
public static void AlterTypeDefinition(this IContentDefinitionManager manager, string name, Action<ContentTypeDefinitionBuilder> alteration) {
|
public static void AlterTypeDefinition(this IContentDefinitionManager manager, string name, Action<ContentTypeDefinitionBuilder> alteration) {
|
||||||
var typeDefinition = manager.GetTypeDefinition(name) ?? new ContentTypeDefinition(name, name);
|
var typeDefinition = manager.GetTypeDefinition(name) ?? new ContentTypeDefinition(name, name.CamelFriendly());
|
||||||
var builder = new ContentTypeDefinitionBuilder(typeDefinition);
|
var builder = new ContentTypeDefinitionBuilder(typeDefinition);
|
||||||
alteration(builder);
|
alteration(builder);
|
||||||
manager.StoreTypeDefinition(builder.Build());
|
manager.StoreTypeDefinition(builder.Build());
|
||||||
|
|||||||
Reference in New Issue
Block a user