mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +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.Models;
|
||||
using Orchard.Tests.ContentManagement;
|
||||
using Orchard.Data.Migration;
|
||||
using Orchard.Data.Providers;
|
||||
|
||||
namespace Orchard.Tests.DataMigration {
|
||||
|
@@ -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]
|
||||
|
@@ -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();
|
||||
|
@@ -77,6 +77,7 @@
|
||||
<Compile Include="Services\ContentDefinitionService.cs" />
|
||||
<Compile Include="Services\IContentDefinitionService.cs" />
|
||||
<Compile Include="ViewModels\AddFieldViewModel.cs" />
|
||||
<Compile Include="ViewModels\ListContentPartsViewModel.cs" />
|
||||
<Compile Include="ViewModels\RemoveFieldViewModel.cs" />
|
||||
<Compile Include="ViewModels\RemovePartViewModel.cs" />
|
||||
<Compile Include="ViewModels\CreateTypeViewModel.cs" />
|
||||
@@ -89,6 +90,7 @@
|
||||
<Content Include="Styles\admin.css" />
|
||||
<Content Include="Views\Admin\AddFieldTo.ascx" />
|
||||
<Content Include="Views\Admin\AddPartsTo.ascx" />
|
||||
<Content Include="Views\Admin\ListParts.ascx" />
|
||||
<Content Include="Views\Admin\RemoveFieldFrom.ascx" />
|
||||
<Content Include="Views\Admin\RemovePartFrom.ascx" />
|
||||
<Content Include="Views\Admin\Create.ascx" />
|
||||
@@ -96,6 +98,7 @@
|
||||
<Content Include="Views\Admin\Edit.ascx" />
|
||||
<Content Include="Views\Admin\List.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\ContentTypeDefinition.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\ContentPartDefinition.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Field.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Fields.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Settings.ascx" />
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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>" %>
|
||||
|
||||
<h1>
|
||||
<%:Html.TitleForPage(T("Content Types").ToString())%></h1>
|
||||
<%
|
||||
Html.RegisterStyle("admin.css"); %>
|
||||
<h1><%:Html.TitleForPage(T("Content Types").ToString())%></h1>
|
||||
<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(
|
||||
Model.Types,
|
||||
(t,i) => Html.DisplayFor(m => t),
|
||||
"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>" %>
|
||||
<%@ Import namespace="Orchard.ContentManagement.MetaData.Models" %>
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<Orchard.ContentManagement.MetaData.Models.ContentTypeDefinition>" %>
|
||||
<div class="summary">
|
||||
<div class="properties">
|
||||
<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 class="related">
|
||||
<%: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(" | ") %>
|
||||
<% 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><%
|
||||
} %>
|
||||
<%:Html.ActionLink(T("Edit").ToString(), "Edit", new {area = "Orchard.ContentTypes", id = Model.Name})%>
|
||||
</div>
|
||||
</div>
|
@@ -1,5 +1,4 @@
|
||||
using Orchard.Data.Migration;
|
||||
using Orchard.Data.Migration;
|
||||
|
||||
namespace Orchard.Users.DataMigrations {
|
||||
public class UsersDataMigration : DataMigrationImpl {
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user