diff --git a/src/Orchard.Core.Tests/Common/Providers/CommonAspectProviderTests.cs b/src/Orchard.Core.Tests/Common/Providers/CommonAspectProviderTests.cs index 210d12203..86b864646 100644 --- a/src/Orchard.Core.Tests/Common/Providers/CommonAspectProviderTests.cs +++ b/src/Orchard.Core.Tests/Common/Providers/CommonAspectProviderTests.cs @@ -16,7 +16,6 @@ using Orchard.ContentManagement.Records; using Orchard.Localization; using Orchard.Security; using Orchard.Tests.Modules; -using Orchard.Mvc.ViewModels; using Orchard.Core.Common.ViewModels; using System.Web.Mvc; diff --git a/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionReaderTests.cs b/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionReaderTests.cs index 07a363a4d..725f07271 100644 --- a/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionReaderTests.cs +++ b/src/Orchard.Tests/ContentManagement/MetaData/Services/ContentDefinitionReaderTests.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Linq; using System.Xml.Linq; using NUnit.Framework; using Orchard.ContentManagement.MetaData; diff --git a/src/Orchard.Tests/ContentManagement/Models/Phi.cs b/src/Orchard.Tests/ContentManagement/Models/Phi.cs index 69bbd39de..719e7aafa 100644 --- a/src/Orchard.Tests/ContentManagement/Models/Phi.cs +++ b/src/Orchard.Tests/ContentManagement/Models/Phi.cs @@ -1,11 +1,10 @@ -using System.Collections.Generic; -using Orchard.ContentManagement; +using Orchard.ContentManagement; using Orchard.ContentManagement.MetaData.Models; namespace Orchard.Tests.ContentManagement.Models { public class Phi : ContentField { public Phi() { - PartFieldDefinition = new ContentPartDefinition.Field(new ContentFieldDefinition("Phi"), "Phi", new Dictionary()); + PartFieldDefinition = new ContentPartDefinition.Field(new ContentFieldDefinition("Phi"), "Phi", new SettingsDictionary()); } } } diff --git a/src/Orchard.Tests/DataMigration/DataMigrationTests.cs b/src/Orchard.Tests/DataMigration/DataMigrationTests.cs new file mode 100644 index 000000000..a12e2e58b --- /dev/null +++ b/src/Orchard.Tests/DataMigration/DataMigrationTests.cs @@ -0,0 +1,276 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Autofac; +using NHibernate; +using NUnit.Framework; +using Orchard.ContentManagement.Records; +using Orchard.Data; +using Orchard.Environment.Extensions; +using Orchard.Environment.Extensions.Folders; +using Orchard.Environment.Extensions.Loaders; +using Orchard.Environment.Extensions.Models; +using Orchard.Tests.ContentManagement; +using Orchard.DataMigration; + +namespace Orchard.Tests.DataMigration { + [TestFixture] + public class DataMigrationTests { + private IContainer _container; + private IExtensionManager _manager; + private StubFolders _folders; + private IDataMigrationManager _dataMigrationManager; + private IRepository _repository; + + private ISessionFactory _sessionFactory; + private ISession _session; + + [SetUp] + public void Init() { + Init(Enumerable.Empty()); + } + + public void Init(IEnumerable dataMigrations) { + + var databaseFileName = System.IO.Path.GetTempFileName(); + _sessionFactory = DataUtility.CreateSessionFactory( + databaseFileName, + typeof(DataMigrationRecord), + typeof(ContentItemVersionRecord), + typeof(ContentItemRecord), + typeof(ContentTypeRecord)); + + var builder = new ContainerBuilder(); + _folders = new StubFolders(); + builder.RegisterInstance(_folders).As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterType().As(); + builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)); + _session = _sessionFactory.OpenSession(); + builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As(); + foreach(var type in dataMigrations) { + builder.RegisterType(type).As(); + } + _container = builder.Build(); + _manager = _container.Resolve(); + _dataMigrationManager = _container.Resolve(); + _repository = _container.Resolve>(); + + } + + public class StubFolders : IExtensionFolders { + public StubFolders() { + Manifests = new Dictionary(); + } + + public IDictionary Manifests { get; set; } + + public IEnumerable AvailableExtensions() { + foreach (var e in Manifests) { + string name = e.Key; + var parseResult = ExtensionFolders.ParseManifest(Manifests[name]); + yield return ExtensionFolders.GetDescriptorForExtension("~/", name, "Module", parseResult); + } + } + } + + public class DataMigrationEmpty : IDataMigration { + public string Feature { + get { return "Feature1"; } + } + } + + public class DataMigration11 : IDataMigration { + public string Feature { + get { return "Feature1"; } + } + } + + public class DataMigration11Create : IDataMigration { + public string Feature { + get { return "Feature1"; } + } + + public int Create() { + return 999; + } + } + + public class DataMigrationCreateCanBeFollowedByUpdates : IDataMigration { + public string Feature { + get { return "Feature1"; } + } + + public int Create() { + return 42; + } + + public int UpdateFrom42() { + return 666; + } + } + + public class DataMigrationSameMigrationClassCanEvolve : IDataMigration { + public string Feature { + get { return "Feature1"; } + } + + public int Create() { + return 999; + } + + public int UpdateFrom42() { + return 666; + } + + public int UpdateFrom666() { + return 999; + } + + } + + public class DataMigrationDependenciesModule1 : IDataMigration { + public string Feature { + get { return "Feature1"; } + } + + public int Create() { + return 999; + } + } + public class DataMigrationDependenciesModule2 : IDataMigration { + public string Feature { + get { return "Feature2"; } + } + + public int Create() { + return 999; + } + } + + [Test] + public void DataMigrationShouldDoNothingIfNoDataMigrationIsProvidedForFeature() { + Init(new Type[] {typeof (DataMigrationEmpty)}); + + _folders.Manifests.Add("Module2", @" +name: Module2 +version: 0.1 +orchardversion: 1 +features: + Feature1: + Description: Feature +"); + + _dataMigrationManager.Upgrade("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(0)); + } + + [Test] + public void DataMigrationShouldDoNothingIfNoUpgradeOrCreateMethodWasFound() { + Init(new Type[] { typeof(DataMigration11) }); + + _folders.Manifests.Add("Module1", @" +name: Module1 +version: 0.1 +orchardversion: 1 +features: + Feature1: + Description: Feature +"); + + _dataMigrationManager.Upgrade("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(0)); + } + + [Test] + public void CreateShouldReturnVersionNumber() { + Init(new Type[] { typeof(DataMigration11Create) }); + + _folders.Manifests.Add("Module1", @" +name: Module1 +version: 0.1 +orchardversion: 1 +features: + Feature1: + Description: Feature +"); + + _dataMigrationManager.Upgrade("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(1)); + Assert.That(_repository.Table.First().Current, Is.EqualTo(999)); + Assert.That(_repository.Table.First().DataMigrationClass, Is.EqualTo("Orchard.Tests.DataMigration.DataMigrationTests+DataMigration11Create")); + } + + [Test] + public void CreateCanBeFollowedByUpdates() { + Init(new Type[] {typeof (DataMigrationCreateCanBeFollowedByUpdates)}); + + _folders.Manifests.Add("Module1", @" +name: Module1 +version: 0.1 +orchardversion: 1 +features: + Feature1: + Description: Feature +"); + + _dataMigrationManager.Upgrade("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(1)); + Assert.That(_repository.Table.First().Current, Is.EqualTo(666)); + } + + [Test] + public void SameMigrationClassCanEvolve() { + Init(new Type[] { typeof(DataMigrationSameMigrationClassCanEvolve) }); + + _folders.Manifests.Add("Module1", @" +name: Module1 +version: 0.1 +orchardversion: 1 +features: + Feature1: + Description: Feature +"); + _repository.Create(new DataMigrationRecord() { + Current = 42, + DataMigrationClass = "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationSameMigrationClassCanEvolve" + }); + + _dataMigrationManager.Upgrade("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(1)); + Assert.That(_repository.Table.First().Current, Is.EqualTo(999)); + } + + [Test] + public void DependenciesShouldBeUpgradedFirst() { + + Init(new Type[] { typeof(DataMigrationDependenciesModule1), typeof(DataMigrationDependenciesModule2) }); + + _folders.Manifests.Add("Module1", @" +name: Module1 +version: 0.1 +orchardversion: 1 +features: + Feature1: + Description: Feature + Dependencies: Feature2 +"); + + _folders.Manifests.Add("Module2", @" +name: Module2 +version: 0.1 +orchardversion: 1 +features: + Feature2: + Description: Feature +"); + _dataMigrationManager.Upgrade("Feature1"); + Assert.That(_repository.Table.Count(), Is.EqualTo(2)); + Assert.That(_repository.Fetch(d => d.Current == 999).Count(), Is.EqualTo(2)); + Assert.That(_repository.Fetch(d => d.DataMigrationClass == "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationDependenciesModule1").Count(), Is.EqualTo(1)); + Assert.That(_repository.Fetch(d => d.DataMigrationClass == "Orchard.Tests.DataMigration.DataMigrationTests+DataMigrationDependenciesModule2").Count(), Is.EqualTo(1)); + } + + } +} \ No newline at end of file diff --git a/src/Orchard.Tests/Orchard.Framework.Tests.csproj b/src/Orchard.Tests/Orchard.Framework.Tests.csproj index 682e28b16..b6393e39a 100644 --- a/src/Orchard.Tests/Orchard.Framework.Tests.csproj +++ b/src/Orchard.Tests/Orchard.Framework.Tests.csproj @@ -180,6 +180,7 @@ Code + diff --git a/src/Orchard.Web/Core/Common/Drivers/CommonDriver.cs b/src/Orchard.Web/Core/Common/Drivers/CommonDriver.cs index b8078ffce..9def86b45 100644 --- a/src/Orchard.Web/Core/Common/Drivers/CommonDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/CommonDriver.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using Orchard.ContentManagement; +using Orchard.ContentManagement; using Orchard.ContentManagement.Drivers; using Orchard.Core.Common.Models; using Orchard.Core.Common.ViewModels; diff --git a/src/Orchard.Web/Core/Contents/ContentTypeDefinitionStub.cs b/src/Orchard.Web/Core/Contents/ContentTypeDefinitionStub.cs deleted file mode 100644 index 45af29afd..000000000 --- a/src/Orchard.Web/Core/Contents/ContentTypeDefinitionStub.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace Orchard.Core.Contents { - public class ContentTypeDefinitionStub { - [StringLength(128)] - public string Name { get; set; } - [Required, StringLength(1024)] - public string DisplayName { get; set; } - } -} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs index a2f8dcacf..c2756d441 100644 --- a/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Contents/Controllers/AdminController.cs @@ -3,12 +3,13 @@ using System.Linq; using System.Web.Mvc; using System.Web.Routing; using Orchard.ContentManagement; -using Orchard.ContentManagement.MetaData; +using Orchard.ContentManagement.MetaData.Models; using Orchard.Core.Contents.Services; using Orchard.Core.Contents.ViewModels; using Orchard.Data; using Orchard.Localization; using Orchard.Logging; +using Orchard.Mvc.Results; using Orchard.Mvc.ViewModels; using Orchard.UI.Notify; @@ -51,19 +52,19 @@ namespace Orchard.Core.Contents.Controllers { }); } - public ActionResult CreateType(CreateTypeViewModel viewModel) { - if (!Services.Authorizer.Authorize(Permissions.CreateContentType, T("Not allowed to create a content type."))) + public ActionResult CreateType() { + if (!Services.Authorizer.Authorize(Permissions.CreateContentTypes, T("Not allowed to create a content type."))) return new HttpUnauthorizedResult(); - return View(viewModel); + return View(new CreateTypeViewModel()); } [HttpPost, ActionName("CreateType")] public ActionResult CreateTypePOST(CreateTypeViewModel viewModel) { - if (!Services.Authorizer.Authorize(Permissions.CreateContentType, T("Not allowed to create a content type."))) + if (!Services.Authorizer.Authorize(Permissions.CreateContentTypes, T("Not allowed to create a content type."))) return new HttpUnauthorizedResult(); - var model = new ContentTypeDefinitionStub(); + var model = new ContentTypeDefinition(""); TryUpdateModel(model); if (!ModelState.IsValid) { @@ -76,9 +77,69 @@ namespace Orchard.Core.Contents.Controllers { return RedirectToAction("Index"); } + public ActionResult EditType(string id) { + if (!Services.Authorizer.Authorize(Permissions.CreateContentTypes, T("Not allowed to edit a content type."))) + return new HttpUnauthorizedResult(); + + var contentTypeDefinition = _contentDefinitionService.GetTypeDefinition(id); + + if (contentTypeDefinition == null) + return new NotFoundResult(); + + return View(new EditTypeViewModel(contentTypeDefinition)); + } + + [HttpPost, ActionName("EditType")] + public ActionResult EditTypePOST(string id) { + if (!Services.Authorizer.Authorize(Permissions.CreateContentTypes, T("Not allowed to edit a content type."))) + return new HttpUnauthorizedResult(); + + var contentTypeDefinition = _contentDefinitionService.GetTypeDefinition(id); + + if (contentTypeDefinition == null) + return new NotFoundResult(); + + var viewModel = new EditTypeViewModel(); + TryUpdateModel(viewModel); + + if (!ModelState.IsValid) { + return EditType(id); + } + + //todo: apply the changes along the lines of but definately not resembling + // for now this _might_ just get a little messy -> + _contentDefinitionService.AlterTypeDefinition( + new ContentTypeDefinition( + viewModel.Name, + viewModel.DisplayName, + viewModel.Parts.Select( + p => new ContentTypeDefinition.Part( + new ContentPartDefinition( + p.PartDefinition.Name, + p.PartDefinition.Fields.Select( + f => new ContentPartDefinition.Field( + new ContentFieldDefinition(f.FieldDefinition.Name), + f.Name, + f.Settings + ) + ), + p.PartDefinition.Settings + ), + p.Settings + ) + ), + viewModel.Settings + ) + ); + // little == lot + + return RedirectToAction("Index"); + } + #endregion #region Content + #endregion public ActionResult List(ListContentsViewModel model) { diff --git a/src/Orchard.Web/Core/Contents/Permissions.cs b/src/Orchard.Web/Core/Contents/Permissions.cs index 8fc85f1ae..ccc2c9641 100644 --- a/src/Orchard.Web/Core/Contents/Permissions.cs +++ b/src/Orchard.Web/Core/Contents/Permissions.cs @@ -3,15 +3,17 @@ using Orchard.Security.Permissions; namespace Orchard.Core.Contents { public class Permissions : IPermissionProvider { - public static readonly Permission CreateContentType = new Permission { Name = "CreateContentType", Description = "Create custom content type." }; + public static readonly Permission CreateContentTypes = new Permission { Name = "CreateContentTypes", Description = "Create custom content types." }; + public static readonly Permission EditContentTypes = new Permission { Name = "EditContentTypes", Description = "Edit content types." }; public string ModuleName { get { return "Contents"; } } public IEnumerable GetPermissions() { - return new Permission[] { - CreateContentType, + return new [] { + CreateContentTypes, + EditContentTypes, }; } @@ -19,7 +21,7 @@ namespace Orchard.Core.Contents { return new[] { new PermissionStereotype { Name = "Administrator", - Permissions = new[] {CreateContentType} + Permissions = GetPermissions() } }; } diff --git a/src/Orchard.Web/Core/Contents/Services/ContentDefinitionService.cs b/src/Orchard.Web/Core/Contents/Services/ContentDefinitionService.cs index 473bebcea..16052287d 100644 --- a/src/Orchard.Web/Core/Contents/Services/ContentDefinitionService.cs +++ b/src/Orchard.Web/Core/Contents/Services/ContentDefinitionService.cs @@ -25,25 +25,30 @@ namespace Orchard.Core.Contents.Services { } public ContentTypeDefinition GetTypeDefinition(string name) { - throw new NotImplementedException(); + return _contentDefinitionManager.GetTypeDefinition(name); } - public void AddTypeDefinition(ContentTypeDefinitionStub definitionStub) { - if (string.IsNullOrWhiteSpace(definitionStub.Name)) - definitionStub.Name = GenerateTypeName(definitionStub.DisplayName); + public void AddTypeDefinition(ContentTypeDefinition contentTypeDefinition) { + var typeName = string.IsNullOrWhiteSpace(contentTypeDefinition.Name) + ? GenerateTypeName(contentTypeDefinition.DisplayName) + : contentTypeDefinition.Name; - while (_contentDefinitionManager.GetTypeDefinition(definitionStub.Name) != null) - definitionStub.Name = VersionTypeName(definitionStub.Name); + while (_contentDefinitionManager.GetTypeDefinition(typeName) != null) + typeName = VersionTypeName(typeName); //just giving the new type some default parts for now _contentDefinitionManager.AlterTypeDefinition( - definitionStub.Name, - cfg => cfg.Named(definitionStub.Name, definitionStub.DisplayName) + typeName, + cfg => cfg.Named(typeName, contentTypeDefinition.DisplayName) .WithPart("CommonAspect") //.WithPart("RoutableAspect") //need to go the new routable route .WithPart("BodyAspect")); + + Services.Notifier.Information(T("Created content type: {0}", contentTypeDefinition.DisplayName)); + } - Services.Notifier.Information(T("Created content type: {0}", definitionStub.DisplayName)); + public void AlterTypeDefinition(ContentTypeDefinition contentTypeDefinition) { + _contentDefinitionManager.StoreTypeDefinition(contentTypeDefinition); } public void RemoveTypeDefinition(string name) { @@ -69,7 +74,7 @@ namespace Orchard.Core.Contents.Services { } private static string VersionTypeName(string name) { - var version = 2; + int version; var nameParts = name.Split(new[] { '-' }, StringSplitOptions.RemoveEmptyEntries); if (nameParts.Length > 1 && int.TryParse(nameParts.Last(), out version)) { @@ -77,6 +82,9 @@ namespace Orchard.Core.Contents.Services { //this could unintentionally chomp something that looks like a version name = string.Join("-", nameParts.Take(nameParts.Length - 1)); } + else { + version = 2; + } return string.Format("{0}-{1}", name, version); } diff --git a/src/Orchard.Web/Core/Contents/Services/IContentDefinitionService.cs b/src/Orchard.Web/Core/Contents/Services/IContentDefinitionService.cs index c4f996bd9..157e53f3a 100644 --- a/src/Orchard.Web/Core/Contents/Services/IContentDefinitionService.cs +++ b/src/Orchard.Web/Core/Contents/Services/IContentDefinitionService.cs @@ -5,7 +5,8 @@ namespace Orchard.Core.Contents.Services { public interface IContentDefinitionService : IDependency { IEnumerable GetTypeDefinitions(); ContentTypeDefinition GetTypeDefinition(string name); - void AddTypeDefinition(ContentTypeDefinitionStub contentTypeDefinition); + void AddTypeDefinition(ContentTypeDefinition contentTypeDefinition); + void AlterTypeDefinition(ContentTypeDefinition contentTypeDefinition); void RemoveTypeDefinition(string name); } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Styles/admin.css b/src/Orchard.Web/Core/Contents/Styles/admin.css new file mode 100644 index 000000000..d6614bb1f --- /dev/null +++ b/src/Orchard.Web/Core/Contents/Styles/admin.css @@ -0,0 +1,6 @@ +.contents #main h2 { + margin:1.5em 0 .5em; +} +.manage.add-to-type { + margin-top:-4em; +} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/ViewModels/EditTypeViewModel.cs b/src/Orchard.Web/Core/Contents/ViewModels/EditTypeViewModel.cs new file mode 100644 index 000000000..b43cc113b --- /dev/null +++ b/src/Orchard.Web/Core/Contents/ViewModels/EditTypeViewModel.cs @@ -0,0 +1,77 @@ +using System.Collections.Generic; +using System.Linq; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.Mvc.ViewModels; + +namespace Orchard.Core.Contents.ViewModels { + public class EditTypeViewModel : BaseViewModel { + public EditTypeViewModel() { + Settings = new SettingsDictionary(); + Parts = new List(); + } + public EditTypeViewModel(ContentTypeDefinition contentTypeDefinition) { + Name = contentTypeDefinition.Name; + DisplayName = contentTypeDefinition.DisplayName; + Settings = contentTypeDefinition.Settings; + Parts = contentTypeDefinition.Parts.Select(p => new EditTypePartViewModel(p)); + } + + public string Name { get; set; } + public string DisplayName { get; set; } + public SettingsDictionary Settings { get; set; } + public IEnumerable Parts { get; set; } + } + + public class EditTypePartViewModel { + public EditTypePartViewModel() { + Settings = new SettingsDictionary(); + } + public EditTypePartViewModel(ContentTypeDefinition.Part part) { + PartDefinition = new EditPartViewModel(part.PartDefinition); + Settings = part.Settings; + } + + public EditPartViewModel PartDefinition { get; set; } + public SettingsDictionary Settings { get; set; } + } + + public class EditPartViewModel { + public EditPartViewModel() { + Fields = new List(); + Settings = new SettingsDictionary(); + } + public EditPartViewModel(ContentPartDefinition contentPartDefinition) { + Name = contentPartDefinition.Name; + Fields = contentPartDefinition.Fields.Select(f => new EditPartFieldViewModel(f)); + Settings = contentPartDefinition.Settings; + } + + public string Name { get; set; } + public IEnumerable Fields { get; set; } + public SettingsDictionary Settings { get; set; } + } + + public class EditPartFieldViewModel { + public EditPartFieldViewModel() { + Settings = new SettingsDictionary(); + } + public EditPartFieldViewModel(ContentPartDefinition.Field field) { + Name = field.Name; + FieldDefinition = new EditFieldViewModel(field.FieldDefinition); + Settings = field.Settings; + } + + public string Name { get; set; } + public EditFieldViewModel FieldDefinition { get; set; } + public SettingsDictionary Settings { get; set; } + } + + public class EditFieldViewModel { + public EditFieldViewModel() { } + public EditFieldViewModel(ContentFieldDefinition contentFieldDefinition) { + Name = Name; + } + + public string Name { get; set; } + } +} diff --git a/src/Orchard.Web/Core/Contents/Views/Admin/EditType.ascx b/src/Orchard.Web/Core/Contents/Views/Admin/EditType.ascx new file mode 100644 index 000000000..ffce68bcf --- /dev/null +++ b/src/Orchard.Web/Core/Contents/Views/Admin/EditType.ascx @@ -0,0 +1,23 @@ +<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> +<%@ Import Namespace="Orchard.Core.Contents.ViewModels" %><% +Html.RegisterStyle("admin.css"); %> +

<%:Html.TitleForPage(T("Edit Content Type").ToString())%>

<% +using (Html.BeginFormAntiForgeryPost()) { %> + <%:Html.ValidationSummary() %> +
+ + <%:Html.TextBoxFor(m => m.DisplayName, new {@class = "textMedium"}) %> + + <%:Html.TextBoxFor(m => m.Name, new {@class = "textMedium"}) %> +
+ <%:Html.EditorFor(m => m.Settings) %> +

<%:T("Parts") %>

+
<%: Html.ActionLink(T("Add").Text, "AddPart", new { }, new { @class = "button" })%>
+ <%:Html.EditorFor(m => m.Parts, "Parts", "") %> +

<%:T("Fields") %>

+
<%: Html.ActionLink(T("Add").Text, "AddField", new { }, new { @class = "button" })%>
+ <%--<%:Html.EditorFor(m => m.Fields, "ContentTypeFields")%>--%> +
+ +
<% +} %> diff --git a/src/Orchard.Web/Core/Contents/Views/DisplayTemplates/ContentTypeDefinition.ascx b/src/Orchard.Web/Core/Contents/Views/DisplayTemplates/ContentTypeDefinition.ascx index 525247982..7e6b634ae 100644 --- a/src/Orchard.Web/Core/Contents/Views/DisplayTemplates/ContentTypeDefinition.ascx +++ b/src/Orchard.Web/Core/Contents/Views/DisplayTemplates/ContentTypeDefinition.ascx @@ -6,7 +6,7 @@