mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Adding something for the theme zone preview image.
--HG-- branch : dev
This commit is contained in:
@@ -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())
|
||||
|
@@ -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
|
||||
|
@@ -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" />
|
||||
|
@@ -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%;
|
||||
}
|
@@ -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>
|
||||
|
@@ -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>
|
BIN
src/Orchard.Web/Themes/TheThemeMachine/ThemeZonePreview.png
Normal file
BIN
src/Orchard.Web/Themes/TheThemeMachine/ThemeZonePreview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
@@ -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>
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user