Putting some of the older partials into admin zones to see how it goes

--HG--
branch : theming
This commit is contained in:
Louis DeJardin
2010-09-07 01:32:24 -07:00
parent f5baed69b9
commit 2056144c62
5 changed files with 18 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BaseViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<div id="app"><%: Html.ActionLink(T("Project Orchard").ToString(), "Index", new { Area = "", Controller = "Home" })%></div>
<div id="site"><%: Html.ActionLink(T("Your Site").ToString(), "Index", new { Area = "", Controller = "Home" })%></div>

View File

@@ -1,14 +1,21 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %>
<%@ Import Namespace="Orchard.Security" %>
<%
Model.Content.Add(Model.Metadata.ChildContent, "5");
// these are just hacked together to fire existing partials... can change
Model.Header.Add(Display.Header());
Model.Header.Add(Display.User(CurrentUser:Html.Resolve<IAuthenticationService>().GetAuthenticatedUser()), "after");
Html.RegisterStyle("site.css", "1");
Html.RegisterStyle("ie.css", "1").WithCondition("if (lte IE 8)").ForMedia("screen, projection");
Html.RegisterStyle("ie6.css", "1").WithCondition("if (lte IE 6)").ForMedia("screen, projection");
Html.RegisterFootScript("admin.js", "1");
// these are just hacked together to fire existing partials... can change
//Model.Zones.AddRenderPartial("header", "Header", Model);
//Model.Zones.AddRenderPartial("header:after", "User", Model); // todo: (heskew) should be a user display or widget
//Model.Zones.AddRenderPartial("menu", "Menu", Model);
%>
<div id="header" role="banner"><%: Display(Model.Header) %></div>
<div id="content">

View File

@@ -1,4 +1,4 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<BaseViewModel>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<% if (Model.CurrentUser != null) {
%><div id="login"><%: T("User:")%> <%: Model.CurrentUser.UserName %> | <%: Html.ActionLink(T("Logout").ToString(), "LogOff", new { Area = "Orchard.Users", Controller = "Account" }) %></div><%

View File

@@ -8,12 +8,15 @@ namespace Orchard.Mvc.ViewEngines.Razor {
public abstract class WebViewPage<TModel> : System.Web.Mvc.WebViewPage<TModel> {
private object _display;
private object _new;
private Localizer _localizer = NullLocalizer.Instance;
public Localizer T { get { return _localizer; } }
public dynamic Display { get { return _display; } }
public dynamic New { get { return _new; } }
public IDisplayHelperFactory DisplayHelperFactory { get; set; }
public IShapeHelperFactory ShapeHelperFactory { get; set; }
public IAuthorizer Authorizer { get; set; }
@@ -25,6 +28,7 @@ namespace Orchard.Mvc.ViewEngines.Razor {
_localizer = LocalizationUtilities.Resolve(ViewContext, VirtualPath);
_display = DisplayHelperFactory.CreateHelper(ViewContext, this);
_new = ShapeHelperFactory.CreateHelper();
}

View File

@@ -9,11 +9,14 @@ using Orchard.Security.Permissions;
namespace Orchard.Mvc {
public class ViewUserControl<TModel> : System.Web.Mvc.ViewUserControl<TModel> {
private object _display;
private object _new;
private Localizer _localizer = NullLocalizer.Instance;
public Localizer T { get { return _localizer; } }
public dynamic Display { get { return _display; } }
public dynamic New { get { return _new; } }
public IDisplayHelperFactory DisplayHelperFactory { get; set; }
public IShapeHelperFactory ShapeHelperFactory { get; set; }
public IAuthorizer Authorizer { get; set; }
@@ -23,6 +26,7 @@ namespace Orchard.Mvc {
_localizer = LocalizationUtilities.Resolve(viewContext, AppRelativeVirtualPath);
_display = DisplayHelperFactory.CreateHelper(viewContext, this);
_new = ShapeHelperFactory.CreateHelper();
base.RenderView(viewContext);
}