mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Putting some of the older partials into admin zones to see how it goes
--HG-- branch : theming
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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><%
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user