diff --git a/src/Orchard.Tests/DataMigration/DataMigrationTests.cs b/src/Orchard.Tests/DataMigration/DataMigrationTests.cs index bc3c89cc2..d2f14709d 100644 --- a/src/Orchard.Tests/DataMigration/DataMigrationTests.cs +++ b/src/Orchard.Tests/DataMigration/DataMigrationTests.cs @@ -15,7 +15,6 @@ using Orchard.Environment.Extensions; using Orchard.Environment.Extensions.Folders; using Orchard.Environment.Extensions.Models; using Orchard.Tests.ContentManagement; -using Orchard.Data.Migration; using Orchard.Data.Providers; namespace Orchard.Tests.DataMigration { diff --git a/src/Orchard.Tests/Environment/Extensions/ExtensionLoaderCoordinatorTests.cs b/src/Orchard.Tests/Environment/Extensions/ExtensionLoaderCoordinatorTests.cs index 294dae0bf..6e3df715a 100644 --- a/src/Orchard.Tests/Environment/Extensions/ExtensionLoaderCoordinatorTests.cs +++ b/src/Orchard.Tests/Environment/Extensions/ExtensionLoaderCoordinatorTests.cs @@ -17,7 +17,6 @@ namespace Orchard.Tests.Environment.Extensions { public class ExtensionLoaderCoordinatorTests { private IContainer _container; private IExtensionManager _manager; - private IExtensionLoaderCoordinator _loader; private StubFolders _folders; [SetUp] diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.ContentTypes/Controllers/AdminController.cs index 29c7cb4b0..11f04f725 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Controllers/AdminController.cs @@ -84,8 +84,8 @@ namespace Orchard.ContentTypes.Controllers { entry.model.Templates = _extendViewModels.TypePartEditor(entry.definition); var fields = entry.model.PartDefinition.Fields.Join(entry.definition.PartDefinition.Fields, - m => m.FieldDefinition.Name, - d => d.FieldDefinition.Name, + m => m.Name, + d => d.Name, (model, definition) => new { model, definition }); foreach (var field in fields) { @@ -100,8 +100,8 @@ namespace Orchard.ContentTypes.Controllers { if (contentPartDefinition != null) { viewModel.Fields = viewModel.Fields.ToArray(); var fields = viewModel.Fields.Join(contentPartDefinition.Fields, - m => m.FieldDefinition.Name, - d => d.FieldDefinition.Name, + m => m.Name, + d => d.Name, (model, definition) => new { model, definition }); foreach (var field in fields) { @@ -282,6 +282,12 @@ namespace Orchard.ContentTypes.Controllers { #region Parts + public ActionResult ListParts() { + return View(new ListContentPartsViewModel { + Parts = _contentDefinitionService.GetPartDefinitions() + }); + } + public ActionResult EditPart(string id) { if (!Services.Authorizer.Authorize(Permissions.CreateContentTypes, T("Not allowed to edit a content part."))) return new HttpUnauthorizedResult(); diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Orchard.ContentTypes.csproj b/src/Orchard.Web/Modules/Orchard.ContentTypes/Orchard.ContentTypes.csproj index 1d05c5039..b58355bd1 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Orchard.ContentTypes.csproj +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Orchard.ContentTypes.csproj @@ -77,6 +77,7 @@ + @@ -89,6 +90,7 @@ + @@ -96,6 +98,7 @@ + diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Styles/admin.css b/src/Orchard.Web/Modules/Orchard.ContentTypes/Styles/admin.css index 45f1a6104..89a597190 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Styles/admin.css +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Styles/admin.css @@ -1,10 +1,14 @@ .orchard-contenttypes #main h2 { margin:1.5em 0 0; } + +#main .properties p { + margin:0; +} + .manage.add-to-type { margin-top:-3.1em; } - .manage-part { margin-bottom:2em; } diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/ViewModels/ListContentPartsViewModel.cs b/src/Orchard.Web/Modules/Orchard.ContentTypes/ViewModels/ListContentPartsViewModel.cs new file mode 100644 index 000000000..309cf1c3e --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/ViewModels/ListContentPartsViewModel.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; +using Orchard.ContentManagement.MetaData.Models; +using Orchard.Mvc.ViewModels; + +namespace Orchard.ContentTypes.ViewModels { + public class ListContentPartsViewModel : BaseViewModel { + public IEnumerable Parts { get; set; } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Admin/List.ascx b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Admin/List.ascx index 362ac9697..090b286c7 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Admin/List.ascx +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Admin/List.ascx @@ -1,11 +1,13 @@ <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> - -

- <%:Html.TitleForPage(T("Content Types").ToString())%>

+<% + Html.RegisterStyle("admin.css"); %> +

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

- <%: Html.ActionLink(T("Create new type").ToString(), "Create", new{Controller="Admin",Area="Orchard.ContentTypes"}, new { @class = "button primaryAction" })%>
+ <%:Html.ActionLink(T("Create new type").ToString(), "Create", new{Controller="Admin",Area="Orchard.ContentTypes"}, new { @class = "button primaryAction" }) %> + <%:Html.ActionLink(T("Content Parts").ToString(), "ListParts", new{Controller="Admin",Area="Orchard.ContentTypes"}, new { @class = "button" }) %> + <%:Html.UnorderedList( Model.Types, (t,i) => Html.DisplayFor(m => t), "contentItems" - ) %> + ) %> \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Admin/ListParts.ascx b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Admin/ListParts.ascx new file mode 100644 index 000000000..e7c25ac65 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Admin/ListParts.ascx @@ -0,0 +1,11 @@ +<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> +

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

+ +
+ <%:Html.ActionLink(T("Create new part").ToString(), "CreatePart", new{Controller="Admin",Area="Orchard.ContentTypes"}, new { @class = "button primaryAction" }) %> +
+<%:Html.UnorderedList( + Model.Parts, + (t,i) => Html.DisplayFor(m => t), + "contentItems" + ) %> \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/ContentPartDefinition.ascx b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/ContentPartDefinition.ascx new file mode 100644 index 000000000..c785c1215 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/ContentPartDefinition.ascx @@ -0,0 +1,9 @@ +<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> +
+
+

<%:Model.Name%>

+
+ +
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/ContentTypeDefinition.ascx b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/ContentTypeDefinition.ascx index 355388283..9e896922c 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/ContentTypeDefinition.ascx +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/DisplayTemplates/ContentTypeDefinition.ascx @@ -1,15 +1,11 @@ -<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> -<%@ Import namespace="Orchard.ContentManagement.MetaData.Models" %> +<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %>

<%:Model.DisplayName%>

-

<%:Model.Name %> - <%:Html.ActionLink("[new content]", "Create", new {area = "Contents", id = Model.Name}) %>

+

<%:Html.ActionLink(T("Create a new {0}", Model.DisplayName).Text, "Create", new {area = "Contents", id = Model.Name}) %>

\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Users/DataMigrations/UsersDataMigration.cs b/src/Orchard.Web/Modules/Orchard.Users/DataMigrations/UsersDataMigration.cs index d6a00bfeb..89397e04f 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/DataMigrations/UsersDataMigration.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/DataMigrations/UsersDataMigration.cs @@ -1,5 +1,4 @@ using Orchard.Data.Migration; -using Orchard.Data.Migration; namespace Orchard.Users.DataMigrations { public class UsersDataMigration : DataMigrationImpl { diff --git a/src/Orchard/ContentManagement/DataMigrations/FrameworkDataMigration.cs b/src/Orchard/ContentManagement/DataMigrations/FrameworkDataMigration.cs index 3e0ebeabc..acf39e2c2 100644 --- a/src/Orchard/ContentManagement/DataMigrations/FrameworkDataMigration.cs +++ b/src/Orchard/ContentManagement/DataMigrations/FrameworkDataMigration.cs @@ -1,6 +1,4 @@ using Orchard.Data.Migration; -using Orchard.Data.Migration; -using Orchard.Environment.Extensions.Models; namespace Orchard.ContentManagement.DataMigrations { public class FrameworkDataMigration : DataMigrationImpl {