diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/orchard-designertools-shapetracing.js b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/orchard-designertools-shapetracing.js index ef55c8f0e..daef8c22e 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/orchard-designertools-shapetracing.js +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/orchard-designertools-shapetracing.js @@ -121,7 +121,7 @@ var found = false; _this .nextUntil('[end-of="' + shapeNode.id + '"]') // all elements between the script beacons - .children(':not(.shape-tracing-wrapper)') // all children but not inner beacons + .find(':not(.shape-tracing-wrapper)') // all children but not inner beacons .andSelf() // add the first level items .attr('shape-id', shapeNode.id) // add the shape-id attribute .each(function () { @@ -142,7 +142,7 @@ startShapeTracingBeacons.each(function () { var _this = $(this); var shapeNode = this.shapeNode; - var parent = _this.parent('[shape-id!=' + shapeNode.id + ']').get(0); + var parent = _this.parents('[shape-id!=' + shapeNode.id + ']').get(0); shapeNodes[shapeNode.id] = shapeNode; diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs index 6d94cbd2d..0f7207702 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Controllers/AdminController.cs @@ -6,6 +6,7 @@ using Orchard.ContentManagement; using Orchard.Core.Contents.Controllers; using Orchard.DisplayManagement; using Orchard.Environment.Extensions.Models; +using Orchard.FileSystems.VirtualPath; using Orchard.Localization; using Orchard.Logging; using Orchard.Mvc.Extensions; @@ -25,16 +26,19 @@ namespace Orchard.Widgets.Controllers { private readonly IWidgetsService _widgetsService; private readonly ISiteThemeService _siteThemeService; + private readonly IVirtualPathProvider _virtualPathProvider; public AdminController( IOrchardServices services, IWidgetsService widgetsService, IShapeFactory shapeFactory, - ISiteThemeService siteThemeService) { + ISiteThemeService siteThemeService, + IVirtualPathProvider virtualPathProvider) { Services = services; _widgetsService = widgetsService; _siteThemeService = siteThemeService; + _virtualPathProvider = virtualPathProvider; T = NullLocalizer.Instance; Logger = NullLogger.Instance; @@ -67,13 +71,17 @@ namespace Orchard.Widgets.Controllers { IEnumerable allZones = _widgetsService.GetZones(); IEnumerable currentThemesZones = _widgetsService.GetZones(currentTheme); + string zonePreviewImagePath = string.Format("{0}/{1}/ThemeZonePreview.png", currentTheme.Location, currentTheme.Id); + string zonePreviewImage = _virtualPathProvider.FileExists(zonePreviewImagePath) ? zonePreviewImagePath : null; + dynamic viewModel = Shape.ViewModel() .CurrentTheme(currentTheme) .CurrentLayer(currentLayer) .Layers(layers) .Widgets(_widgetsService.GetWidgets()) .Zones(currentThemesZones) - .OrphanZones(allZones.Except(currentThemesZones)); + .OrphanZones(allZones.Except(currentThemesZones)) + .ZonePreviewImage(zonePreviewImage); // Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation. return View((object)viewModel); diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Styles/orchard-widgets-admin.css b/src/Orchard.Web/Modules/Orchard.Widgets/Styles/orchard-widgets-admin.css index 3df5b94d9..89709440f 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Styles/orchard-widgets-admin.css +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Styles/orchard-widgets-admin.css @@ -1,9 +1,12 @@ #layout-widgets-placement { +clear:left; float:left; width:65%; } #layout-widgets-assistance { float:right; +position:relative; +top:-30px; width:35%; } .widgets-container { @@ -17,6 +20,7 @@ padding:2px 2px; #widgets-layers-control { +float:left; margin-bottom:-20px; } #widgets-layers-control label { @@ -163,8 +167,12 @@ color:#333; margin-top:5px; } -#widgets-layer-visibility { -margin-top:20px; +#widgets-theme-zone-preview { +margin:30px 0 20px; +} + +#main #widgets-layer-visibility h3 { +margin-top:0; } #widgets-layer-visibility li { cursor:default; diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Admin/Index.cshtml index a231bb7c3..3589e5220 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Admin/Index.cshtml @@ -10,7 +10,7 @@
- @Display.WidgetSimplePreview(CurrentTheme: Model.CurrentTheme) + @Display.WidgetSimplePreview(ZonePreviewImage: Model.ZonePreviewImage, CurrentTheme: Model.CurrentTheme) @Display.WidgetLayerVisibility(Layers: Model.Layers, CurrentLayer: Model.CurrentLayer)
diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetSimplePreview.cshtml b/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetSimplePreview.cshtml index 349e1f084..7c187e9bb 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetSimplePreview.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Views/WidgetSimplePreview.cshtml @@ -1,2 +1,4 @@ @using Orchard.Environment.Extensions.Models -

@Html.Image(Href(Html.ThemePath((ExtensionDescriptor) Model.CurrentTheme, "/ThemeZonePreview.png")), T("{0} zone preview", (string)Model.CurrentTheme.Name).Text, null)

\ No newline at end of file +@if (HasText(Model.ZonePreviewImage)) { +

@Html.Image(Href((string)Model.ZonePreviewImage), T("{0} zone preview", (string)Model.CurrentTheme.Name).Text, null)

+} \ No newline at end of file