Fixing shape tree ordering

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2011-03-25 12:05:18 -07:00
parent 42fa76dced
commit 8947265a46
3 changed files with 6 additions and 4 deletions

View File

@@ -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) {

View File

@@ -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++;
}

View File

@@ -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
));
}