mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Continuing theming work...
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044184
This commit is contained in:
@@ -1,15 +1,14 @@
|
|||||||
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
|
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BaseViewModel>" %>
|
||||||
|
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||||
<%@ Import Namespace="Orchard.Mvc.Html"
|
<%@ Import Namespace="Orchard.Mvc.Html"
|
||||||
%><!DOCTYPE html>
|
%><!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||||
<title><%=Html.Title() %> - Safe Mode!</title><%
|
<title><%=Html.Title() %> - Safe Mode!</title><%
|
||||||
Html.RenderZone("head", ":metas :styles :scripts"); %>
|
Html.Zone("head", ":metas :styles :scripts"); %>
|
||||||
</head>
|
</head>
|
||||||
<body><%
|
<body><%
|
||||||
Html.RenderZone("document-first");
|
Html.ZoneBody("body"); %>
|
||||||
Html.RenderBody();
|
|
||||||
Html.RenderZone("document-last"); %>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
|
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BaseViewModel>" %>
|
||||||
|
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||||
<%@ Import Namespace="Orchard.Mvc.Html" %><%
|
<%@ Import Namespace="Orchard.Mvc.Html" %><%
|
||||||
Html.RegisterStyle("site.css"); %>
|
Html.RegisterStyle("site.css"); %>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<div id="header"><%
|
<div id="header"><%
|
||||||
Html.RenderZone("header");
|
Html.Zone("header");
|
||||||
Html.RenderZone("menu");
|
Html.Zone("menu");
|
||||||
%></div>
|
%></div>
|
||||||
<div id="main"><%
|
<div id="main"><%
|
||||||
Html.RenderBody();
|
Html.ZoneBody("content");
|
||||||
%> <div id="footer"><%
|
%> <div id="footer"><%
|
||||||
Html.RenderZone("footer");
|
Html.Zone("footer");
|
||||||
%></div>
|
%></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,23 +1,18 @@
|
|||||||
using System.Collections.Generic;
|
using System.Web.Mvc;
|
||||||
using System.Web.Mvc;
|
using Orchard.Mvc.ViewModels;
|
||||||
using Orchard.Mvc.ModelBinders;
|
|
||||||
|
|
||||||
namespace Orchard.Controllers {
|
namespace Orchard.Controllers {
|
||||||
[HandleError]
|
[HandleError]
|
||||||
public class HomeController : Controller {
|
public class HomeController : Controller {
|
||||||
|
|
||||||
|
|
||||||
public ActionResult Index() {
|
public ActionResult Index() {
|
||||||
ViewData["Message"] = "Welcome to ASP.NET MVC!";
|
ViewData["Message"] = "Welcome to ASP.NET MVC!";
|
||||||
|
|
||||||
return View();
|
return View(new BaseViewModel());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult About() {
|
public ActionResult About() {
|
||||||
|
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,9 @@ namespace Orchard.Mvc.Html {
|
|||||||
Zone(html, zoneName, string.Empty);
|
Zone(html, zoneName, string.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RenderZone(this HtmlHelper html, string zoneName, string foo) { }
|
public static void ZoneBody<TModel>(this HtmlHelper<TModel> html, string zoneName) where TModel : BaseViewModel {
|
||||||
|
html.Zone(zoneName, () => html.RenderBody());
|
||||||
|
}
|
||||||
|
|
||||||
public static void RegisterStyle(this HtmlHelper html, string styleName) {
|
public static void RegisterStyle(this HtmlHelper html, string styleName) {
|
||||||
//todo: register the style
|
//todo: register the style
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
using Orchard.Mvc.ViewModels;
|
||||||
|
|
||||||
namespace Orchard.Mvc.ViewEngines {
|
namespace Orchard.Mvc.ViewEngines {
|
||||||
public class LayoutViewEngine : IViewEngine {
|
public class LayoutViewEngine : IViewEngine {
|
||||||
@@ -26,7 +25,8 @@ namespace Orchard.Mvc.ViewEngines {
|
|||||||
|
|
||||||
// if action returned a View with explicit master -
|
// if action returned a View with explicit master -
|
||||||
// this will bypass the multi-pass layout strategy
|
// this will bypass the multi-pass layout strategy
|
||||||
if (!string.IsNullOrEmpty(masterName))
|
if (!string.IsNullOrEmpty(masterName)
|
||||||
|
|| !(controllerContext.Controller.ViewData.Model is BaseViewModel))
|
||||||
return new ViewEngineResult(Enumerable.Empty<string>());
|
return new ViewEngineResult(Enumerable.Empty<string>());
|
||||||
|
|
||||||
var bodyView = _viewEngines.FindPartialView(controllerContext, viewName);
|
var bodyView = _viewEngines.FindPartialView(controllerContext, viewName);
|
||||||
|
|||||||
Reference in New Issue
Block a user