Adding something for the theme zone preview image.

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2011-03-23 12:00:45 -07:00
parent f98505d75f
commit 86c6e4052f
9 changed files with 23 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ using Orchard.DisplayManagement;
using Orchard.Localization;
using Orchard.Logging;
using Orchard.Mvc.Extensions;
using Orchard.Themes.Services;
using Orchard.UI.Admin;
using Orchard.UI.Notify;
using Orchard.Utility.Extensions;
@@ -22,14 +23,17 @@ namespace Orchard.Widgets.Controllers {
private const string NotAuthorizedManageWidgetsLabel = "Not authorized to manage widgets";
private readonly IWidgetsService _widgetsService;
private readonly ISiteThemeService _siteThemeService;
public AdminController(
IOrchardServices services,
IWidgetsService widgetsService,
IShapeFactory shapeFactory) {
IShapeFactory shapeFactory,
ISiteThemeService siteThemeService) {
Services = services;
_widgetsService = widgetsService;
_siteThemeService = siteThemeService;
T = NullLocalizer.Instance;
Logger = NullLogger.Instance;
@@ -59,6 +63,7 @@ namespace Orchard.Widgets.Controllers {
}
dynamic viewModel = Shape.ViewModel()
.CurrentTheme(_siteThemeService.GetSiteTheme())
.CurrentLayer(currentLayer)
.Layers(layers)
.Widgets(_widgetsService.GetWidgets())

View File

@@ -7,4 +7,4 @@ OrchardVersion: 1.0.20
Description: An implementation of widgets for Orchard.
FeatureDescription: An implementation of widgets.
Category: Widget
Dependencies: Orchard.Scripting
Dependencies: Orchard.Scripting, Themes

View File

@@ -106,6 +106,10 @@
<Project>{99002B65-86F7-415E-BF4A-381AA8AB9CCC}</Project>
<Name>Orchard.Scripting</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard.Themes\Orchard.Themes.csproj">
<Project>{CDE24A24-01D3-403C-84B9-37722E18DFB7}</Project>
<Name>Orchard.Themes</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Views\Admin\AddLayer.cshtml" />

View File

@@ -168,4 +168,9 @@ margin:-32px 10px -2px 0;
#widgets-placement .summary-view .widgets-none {
display:none;
}
/* end: switchable tweaks */
/* end: switchable tweaks */
/* ...and the current state of the theme zone preview */
#widgets-theme-zone-preview img {
width:100%;
}

View File

@@ -10,7 +10,7 @@
<div id="layout-widgets-assistance">
<div id="widgets-assistance">
<div class="widgets-container">
@Display.WidgetSimplePreview()
@Display.WidgetSimplePreview(CurrentTheme: Model.CurrentTheme)
@Display.WidgetLayerVisibility(Layers: Model.Layers, CurrentLayer: Model.CurrentLayer)
</div>
</div>

View File

@@ -1 +1,2 @@
<p>[[theme preview image]]</p>
@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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -70,6 +70,7 @@
</Content>
<Content Include="TheAdmin\Views\Pager.cshtml" />
<Content Include="TheAdmin\Views\OrchardVersion.cshtml" />
<Content Include="TheThemeMachine\ThemeZonePreview.png" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>

View File

@@ -32,6 +32,7 @@
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*/Theme.png" verb="*" type="System.Web.StaticFileHandler" />
<add path="*/ThemeZonePreview.png" verb="*" type="System.Web.StaticFileHandler" />
</httpHandlers>
<!--
Enabling request validation in view pages would cause validation to occur
@@ -67,6 +68,7 @@
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="ThemePreviewImage" path="*/Theme.png" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
<add name="ThemeZonePreviewImage" path="*/ThemeZonePreview.png" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
</handlers>
</system.webServer>
<runtime>