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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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<string> allZones = _widgetsService.GetZones();
|
||||
IEnumerable<string> 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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div id="layout-widgets-assistance">
|
||||
<div id="widgets-assistance">
|
||||
<div class="widgets-container">
|
||||
@Display.WidgetSimplePreview(CurrentTheme: Model.CurrentTheme)
|
||||
@Display.WidgetSimplePreview(ZonePreviewImage: Model.ZonePreviewImage, CurrentTheme: Model.CurrentTheme)
|
||||
@Display.WidgetLayerVisibility(Layers: Model.Layers, CurrentLayer: Model.CurrentLayer)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
@using Orchard.Environment.Extensions.Models
|
||||
<p id="widgets-theme-zone-preview">@Html.Image(Href(Html.ThemePath((ExtensionDescriptor) Model.CurrentTheme, "/ThemeZonePreview.png")), T("{0} zone preview", (string)Model.CurrentTheme.Name).Text, null)</p>
|
||||
@if (HasText(Model.ZonePreviewImage)) {
|
||||
<p id="widgets-theme-zone-preview">@Html.Image(Href((string)Model.ZonePreviewImage), T("{0} zone preview", (string)Model.CurrentTheme.Name).Text, null)</p>
|
||||
}
|
||||
Reference in New Issue
Block a user