Retiring ContentItemViewModel

...and all that entails
- things like IZone and IZoneCollection are barely roughed in

--HG--
branch : theming
This commit is contained in:
Nathan Heskew
2010-09-03 16:04:42 -07:00
parent 0d91cf30ac
commit 043bcf54ee
76 changed files with 419 additions and 357 deletions

View File

@@ -2,8 +2,8 @@
using System.Reflection;
using System.Web;
using System.Web.Mvc;
using Orchard.DisplayManagement;
using Orchard.Localization;
using Orchard.Mvc.ViewModels;
using Orchard.Security;
using Orchard.Themes.Preview;
using Orchard.Themes.ViewModels;
@@ -15,13 +15,20 @@ namespace Orchard.Themes.Controllers {
private readonly IThemeService _themeService;
private readonly IPreviewTheme _previewTheme;
public AdminController(IOrchardServices services, IThemeService themeService, IPreviewTheme previewTheme, IAuthorizer authorizer, INotifier notifier) {
public AdminController(
IOrchardServices services,
IThemeService themeService,
PreviewTheme previewTheme,
IAuthorizer authorizer,
INotifier notifier,
IShapeHelperFactory shapeHelperFactory) {
Services = services;
_themeService = themeService;
_previewTheme = previewTheme;
T = NullLocalizer.Instance;
}
dynamic Shape { get; set; }
public IOrchardServices Services{ get; set; }
public Localizer T { get; set; }
@@ -30,11 +37,11 @@ namespace Orchard.Themes.Controllers {
var themes = _themeService.GetInstalledThemes();
var currentTheme = _themeService.GetSiteTheme();
var model = new ThemesIndexViewModel { CurrentTheme = currentTheme, Themes = themes };
return View(model);
return View(Shape.Model(model));
}
catch (Exception exception) {
Services.Notifier.Error(T("Listing themes failed: " + exception.Message));
return View(new ThemesIndexViewModel());
return View(Shape.Model(new ThemesIndexViewModel()));
}
}

View File

@@ -9,6 +9,7 @@ using Orchard.Services;
using Orchard.UI.Zones;
namespace Orchard.Themes.DesignerNotes {
#if REFACTORING
public class ZoneManagerEvents : IZoneManagerEvents {
private readonly IThemeService _themeService;
private readonly IAuthorizationService _authorizationService;
@@ -82,4 +83,5 @@ namespace Orchard.Themes.DesignerNotes {
public void ZoneRendered(ZoneRenderContext context) {
}
}
#endif
}

View File

@@ -104,7 +104,7 @@
<Content Include="Views\Admin\Install.aspx" />
<Content Include="Views\Admin\ThemePreview.ascx" />
<Content Include="Views\DisplayTemplates\Items\ContentItem.ascx" />
<Content Include="Views\Document.aspx" />
<Content Include="Views\_Document.aspx" />
<Content Include="Views\EditorTemplates\Items\ContentItem.ascx" />
<Content Include="Views\Header.ascx" />
<Content Include="Views\HeadPreload.ascx" />
@@ -128,6 +128,9 @@
<Name>Orchard.Framework</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Views\Document.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -2,6 +2,7 @@
using Orchard.UI.Zones;
namespace Orchard.Themes.Services {
#if REFACTORING
public class ThemeZoneManagerEvents : IZoneManagerEvents {
public ThemeZoneManagerEvents() {
T = NullLocalizer.Instance;
@@ -47,4 +48,5 @@ namespace Orchard.Themes.Services {
#endif
}
}
#endif
}

View File

@@ -0,0 +1,24 @@
@using Orchard.Mvc.Html
<!DOCTYPE html>
@//"en" needs to change to the current culture, btw
@//all inline styles for tmp reference only
<html lang="en" class="static" style="background:#000;color:#fff;padding:5px">
<head>
<title>Page Title@{/*View.Page.Title*/}</title>
@//could be a resource - at least need to get at the right location and this is something
<link rel="shortcut icon" type="image/x-icon" href="/modules/orchard.themes/Content/orchard.ico" />
@{
//todo: (heskew) have resource modules that can be leaned on (like a jQuery module that knows about various CDNs and jQuery's version and min naming schemes)
//todo: (heskew) this is an interim solution to inlude jQuery in every page and still allow that to be overriden in some theme by it containing a headScripts partial
}
@//Model.Zones.AddRenderPartial("head:before", "HeadPreload", Model);
@//Html.Zone("head", ":metas :styles :scripts"); %>
<script type="text/javascript">document.documentElement.className="dyn";</script>
</head>
<body class="@Html.ClassForPage()">
<section>
<h1>document template</h1>
@Html.RenderOrchardBody()
</section>
</body>
</html>