mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Fixing shape tree ordering
--HG-- branch : dev
This commit is contained in:
@@ -113,7 +113,7 @@ namespace Orchard.DesignerTools.Services {
|
||||
}
|
||||
|
||||
_node.Add(_node = new XElement("ul"));
|
||||
foreach (var member in members) {
|
||||
foreach (var member in members.OrderBy(m => m.Name)) {
|
||||
if (o is ContentItem && member.Name == "ContentManager") {
|
||||
// ignore Content Manager explicitly
|
||||
continue;
|
||||
@@ -127,7 +127,6 @@ namespace Orchard.DesignerTools.Services {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// process ContentPart.Fields specifically
|
||||
if (o is ContentPart && member.Name == "Fields") {
|
||||
foreach (var field in ((ContentPart)o).Fields) {
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace Orchard.DesignerTools.Services {
|
||||
private readonly IThemeManager _themeManager;
|
||||
private readonly IWebSiteFolder _webSiteFolder;
|
||||
private readonly IAuthorizer _authorizer;
|
||||
private int shapeId = 0;
|
||||
|
||||
public ShapeTracingFactory(
|
||||
WorkContext workContext,
|
||||
@@ -132,6 +133,8 @@ namespace Orchard.DesignerTools.Services {
|
||||
if(shapeMetadata.Type == "Zone") {
|
||||
shape.Hint = ((Zone) shape).ZoneName;
|
||||
}
|
||||
|
||||
shape.ShapeId = shapeId++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
Script.Include("CodeMirror/htmlmixed.js");
|
||||
}
|
||||
|
||||
<script class="shape-tracing-wrapper" shape-id="@Model.GetHashCode()" shape-type="@Model.Metadata.Type" shape-hint="@Model.Hint"></script>@Display(Model.Metadata.ChildContent)<script class="shape-tracing-wrapper" end-of="@Model.GetHashCode()"></script>
|
||||
<script class="shape-tracing-wrapper" shape-id="@Model.ShapeId" shape-type="@Model.Metadata.Type" shape-hint="@Model.Hint"></script>@Display(Model.Metadata.ChildContent)<script class="shape-tracing-wrapper" end-of="@Model.ShapeId"></script>
|
||||
@{
|
||||
Layout.Zones["Tail"].Add(
|
||||
New.ShapeTracingMeta(
|
||||
@@ -36,6 +36,6 @@
|
||||
Alternates: Model.Metadata.Alternates,
|
||||
Wrappers: Model.Metadata.Wrappers,
|
||||
ChildContent: Model.Metadata.ChildContent,
|
||||
ShapeId: Model.GetHashCode()
|
||||
ShapeId: Model.ShapeId
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user