mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -15,7 +15,6 @@ using Orchard.Environment.Extensions;
|
|||||||
using Orchard.Environment.Extensions.Folders;
|
using Orchard.Environment.Extensions.Folders;
|
||||||
using Orchard.Environment.Extensions.Models;
|
using Orchard.Environment.Extensions.Models;
|
||||||
using Orchard.Tests.ContentManagement;
|
using Orchard.Tests.ContentManagement;
|
||||||
using Orchard.Data.Migration;
|
|
||||||
using Orchard.Data.Providers;
|
using Orchard.Data.Providers;
|
||||||
|
|
||||||
namespace Orchard.Tests.DataMigration {
|
namespace Orchard.Tests.DataMigration {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ namespace Orchard.Tests.Environment.Extensions {
|
|||||||
public class ExtensionLoaderCoordinatorTests {
|
public class ExtensionLoaderCoordinatorTests {
|
||||||
private IContainer _container;
|
private IContainer _container;
|
||||||
private IExtensionManager _manager;
|
private IExtensionManager _manager;
|
||||||
private IExtensionLoaderCoordinator _loader;
|
|
||||||
private StubFolders _folders;
|
private StubFolders _folders;
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ namespace Orchard.ContentTypes.Controllers {
|
|||||||
entry.model.Templates = _extendViewModels.TypePartEditor(entry.definition);
|
entry.model.Templates = _extendViewModels.TypePartEditor(entry.definition);
|
||||||
|
|
||||||
var fields = entry.model.PartDefinition.Fields.Join(entry.definition.PartDefinition.Fields,
|
var fields = entry.model.PartDefinition.Fields.Join(entry.definition.PartDefinition.Fields,
|
||||||
m => m.FieldDefinition.Name,
|
m => m.Name,
|
||||||
d => d.FieldDefinition.Name,
|
d => d.Name,
|
||||||
(model, definition) => new { model, definition });
|
(model, definition) => new { model, definition });
|
||||||
|
|
||||||
foreach (var field in fields) {
|
foreach (var field in fields) {
|
||||||
@@ -100,8 +100,8 @@ namespace Orchard.ContentTypes.Controllers {
|
|||||||
if (contentPartDefinition != null) {
|
if (contentPartDefinition != null) {
|
||||||
viewModel.Fields = viewModel.Fields.ToArray();
|
viewModel.Fields = viewModel.Fields.ToArray();
|
||||||
var fields = viewModel.Fields.Join(contentPartDefinition.Fields,
|
var fields = viewModel.Fields.Join(contentPartDefinition.Fields,
|
||||||
m => m.FieldDefinition.Name,
|
m => m.Name,
|
||||||
d => d.FieldDefinition.Name,
|
d => d.Name,
|
||||||
(model, definition) => new { model, definition });
|
(model, definition) => new { model, definition });
|
||||||
|
|
||||||
foreach (var field in fields) {
|
foreach (var field in fields) {
|
||||||
@@ -282,6 +282,12 @@ namespace Orchard.ContentTypes.Controllers {
|
|||||||
|
|
||||||
#region Parts
|
#region Parts
|
||||||
|
|
||||||
|
public ActionResult ListParts() {
|
||||||
|
return View(new ListContentPartsViewModel {
|
||||||
|
Parts = _contentDefinitionService.GetPartDefinitions()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public ActionResult EditPart(string id) {
|
public ActionResult EditPart(string id) {
|
||||||
if (!Services.Authorizer.Authorize(Permissions.CreateContentTypes, T("Not allowed to edit a content part.")))
|
if (!Services.Authorizer.Authorize(Permissions.CreateContentTypes, T("Not allowed to edit a content part.")))
|
||||||
return new HttpUnauthorizedResult();
|
return new HttpUnauthorizedResult();
|
||||||
|
|||||||
@@ -77,6 +77,7 @@
|
|||||||
<Compile Include="Services\ContentDefinitionService.cs" />
|
<Compile Include="Services\ContentDefinitionService.cs" />
|
||||||
<Compile Include="Services\IContentDefinitionService.cs" />
|
<Compile Include="Services\IContentDefinitionService.cs" />
|
||||||
<Compile Include="ViewModels\AddFieldViewModel.cs" />
|
<Compile Include="ViewModels\AddFieldViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\ListContentPartsViewModel.cs" />
|
||||||
<Compile Include="ViewModels\RemoveFieldViewModel.cs" />
|
<Compile Include="ViewModels\RemoveFieldViewModel.cs" />
|
||||||
<Compile Include="ViewModels\RemovePartViewModel.cs" />
|
<Compile Include="ViewModels\RemovePartViewModel.cs" />
|
||||||
<Compile Include="ViewModels\CreateTypeViewModel.cs" />
|
<Compile Include="ViewModels\CreateTypeViewModel.cs" />
|
||||||
@@ -89,6 +90,7 @@
|
|||||||
<Content Include="Styles\admin.css" />
|
<Content Include="Styles\admin.css" />
|
||||||
<Content Include="Views\Admin\AddFieldTo.ascx" />
|
<Content Include="Views\Admin\AddFieldTo.ascx" />
|
||||||
<Content Include="Views\Admin\AddPartsTo.ascx" />
|
<Content Include="Views\Admin\AddPartsTo.ascx" />
|
||||||
|
<Content Include="Views\Admin\ListParts.ascx" />
|
||||||
<Content Include="Views\Admin\RemoveFieldFrom.ascx" />
|
<Content Include="Views\Admin\RemoveFieldFrom.ascx" />
|
||||||
<Content Include="Views\Admin\RemovePartFrom.ascx" />
|
<Content Include="Views\Admin\RemovePartFrom.ascx" />
|
||||||
<Content Include="Views\Admin\Create.ascx" />
|
<Content Include="Views\Admin\Create.ascx" />
|
||||||
@@ -96,6 +98,7 @@
|
|||||||
<Content Include="Views\Admin\Edit.ascx" />
|
<Content Include="Views\Admin\Edit.ascx" />
|
||||||
<Content Include="Views\Admin\List.ascx" />
|
<Content Include="Views\Admin\List.ascx" />
|
||||||
<Content Include="Views\DisplayTemplates\ContentTypeDefinition.ascx" />
|
<Content Include="Views\DisplayTemplates\ContentTypeDefinition.ascx" />
|
||||||
|
<Content Include="Views\DisplayTemplates\ContentPartDefinition.ascx" />
|
||||||
<Content Include="Views\DisplayTemplates\Field.ascx" />
|
<Content Include="Views\DisplayTemplates\Field.ascx" />
|
||||||
<Content Include="Views\DisplayTemplates\Fields.ascx" />
|
<Content Include="Views\DisplayTemplates\Fields.ascx" />
|
||||||
<Content Include="Views\DisplayTemplates\Settings.ascx" />
|
<Content Include="Views\DisplayTemplates\Settings.ascx" />
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
.orchard-contenttypes #main h2 {
|
.orchard-contenttypes #main h2 {
|
||||||
margin:1.5em 0 0;
|
margin:1.5em 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#main .properties p {
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
|
||||||
.manage.add-to-type {
|
.manage.add-to-type {
|
||||||
margin-top:-3.1em;
|
margin-top:-3.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manage-part {
|
.manage-part {
|
||||||
margin-bottom:2em;
|
margin-bottom:2em;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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<ContentPartDefinition> Parts { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentTypes.ViewModels.ListContentTypesViewModel>" %>
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentTypes.ViewModels.ListContentTypesViewModel>" %>
|
||||||
|
<%
|
||||||
<h1>
|
Html.RegisterStyle("admin.css"); %>
|
||||||
<%:Html.TitleForPage(T("Content Types").ToString())%></h1>
|
<h1><%:Html.TitleForPage(T("Content Types").ToString())%></h1>
|
||||||
<div class="manage">
|
<div class="manage">
|
||||||
<%: Html.ActionLink(T("Create new type").ToString(), "Create", new{Controller="Admin",Area="Orchard.ContentTypes"}, new { @class = "button primaryAction" })%></div>
|
<%: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" }) %>
|
||||||
|
</div>
|
||||||
<%:Html.UnorderedList(
|
<%:Html.UnorderedList(
|
||||||
Model.Types,
|
Model.Types,
|
||||||
(t,i) => Html.DisplayFor(m => t),
|
(t,i) => Html.DisplayFor(m => t),
|
||||||
"contentItems"
|
"contentItems"
|
||||||
) %>
|
) %>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentTypes.ViewModels.ListContentPartsViewModel>" %>
|
||||||
|
<h1><%:Html.TitleForPage(T("Content Parts").ToString())%></h1>
|
||||||
|
<p class="breadcrumb"><%:Html.ActionLink(T("Content Types").Text, "index") %><%:T(" > ") %><%:T("Content Parts") %></p>
|
||||||
|
<div class="manage">
|
||||||
|
<%:Html.ActionLink(T("Create new part").ToString(), "CreatePart", new{Controller="Admin",Area="Orchard.ContentTypes"}, new { @class = "button primaryAction" }) %>
|
||||||
|
</div>
|
||||||
|
<%:Html.UnorderedList(
|
||||||
|
Model.Parts,
|
||||||
|
(t,i) => Html.DisplayFor(m => t),
|
||||||
|
"contentItems"
|
||||||
|
) %>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentManagement.MetaData.Models.ContentPartDefinition>" %>
|
||||||
|
<div class="summary">
|
||||||
|
<div class="properties">
|
||||||
|
<h3><%:Model.Name%></h3>
|
||||||
|
</div>
|
||||||
|
<div class="related">
|
||||||
|
<%:Html.ActionLink(T("Edit").ToString(), "EditPart", new {area = "Orchard.ContentTypes", id = Model.Name})%>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -1,15 +1,11 @@
|
|||||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentTypeDefinition>" %>
|
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentManagement.MetaData.Models.ContentTypeDefinition>" %>
|
||||||
<%@ Import namespace="Orchard.ContentManagement.MetaData.Models" %>
|
|
||||||
<div class="summary">
|
<div class="summary">
|
||||||
<div class="properties">
|
<div class="properties">
|
||||||
<h3><%:Model.DisplayName%></h3>
|
<h3><%:Model.DisplayName%></h3>
|
||||||
<p><%:Model.Name %> - <%:Html.ActionLink("[new content]", "Create", new {area = "Contents", id = Model.Name}) %></p>
|
<p class="pageStatus"><%:Html.ActionLink(T("Create a new {0}", Model.DisplayName).Text, "Create", new {area = "Contents", id = Model.Name}) %></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="related">
|
<div class="related">
|
||||||
<%:Html.ActionLink(T("List Items").ToString(), "List", new {area = "Contents", id = Model.Name})%><%:T(" | ")%>
|
<%:Html.ActionLink(T("List Items").ToString(), "List", new {area = "Contents", id = Model.Name})%><%:T(" | ")%>
|
||||||
<%:Html.ActionLink(T("Edit").ToString(), "Edit", new {area = "Orchard.ContentTypes", id = Model.Name})%><%:T(" | ") %>
|
<%:Html.ActionLink(T("Edit").ToString(), "Edit", new {area = "Orchard.ContentTypes", id = Model.Name})%>
|
||||||
<% using (Html.BeginFormAntiForgeryPost(Url.Action("RemoveType", new {area = "Orchard.ContentTypes", id = Model.Name}), FormMethod.Post, new { @class = "inline link" })) { %>
|
|
||||||
<button type="submit" class="linkButton" title="<%:T("Delete") %>"><%:T("[Delete]")%></button><%
|
|
||||||
} %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using Orchard.Data.Migration;
|
using Orchard.Data.Migration;
|
||||||
using Orchard.Data.Migration;
|
|
||||||
|
|
||||||
namespace Orchard.Users.DataMigrations {
|
namespace Orchard.Users.DataMigrations {
|
||||||
public class UsersDataMigration : DataMigrationImpl {
|
public class UsersDataMigration : DataMigrationImpl {
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Orchard.Data.Migration;
|
using Orchard.Data.Migration;
|
||||||
using Orchard.Data.Migration;
|
|
||||||
using Orchard.Environment.Extensions.Models;
|
|
||||||
|
|
||||||
namespace Orchard.ContentManagement.DataMigrations {
|
namespace Orchard.ContentManagement.DataMigrations {
|
||||||
public class FrameworkDataMigration : DataMigrationImpl {
|
public class FrameworkDataMigration : DataMigrationImpl {
|
||||||
|
|||||||
Reference in New Issue
Block a user