More progress on defining new UI capabilities.

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-10-05 08:28:06 -07:00
parent ce208c44f2
commit f3af5ea7d9
8 changed files with 80 additions and 56 deletions

View File

@@ -15,7 +15,7 @@
@//Model.Zones.AddRenderPartial("head:before", "HeadPreload", Model);
@//Html.Zone("head", ":metas :styles :scripts"); %>
@Display(Model.Head)
<script>(function(d){d.className="dyn "+d.className.substring(7,d.length);})(document.documentElement);</script>
<script>(function(d){d.className="dyn"+d.className.substring(6,d.className.length);})(document.documentElement);</script>
</head>
<body>
@Display(Model.Body)

View File

@@ -113,6 +113,7 @@
<Content Include="Themes\TheThemeMachine\draft.html" />
<Content Include="Themes\TheThemeMachine\Theme.png" />
<Content Include="Themes\TheThemeMachine\Theme.txt" />
<None Include="Themes\TheThemeMachine\Views\Document.cshtml" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
@@ -285,11 +286,10 @@
<Content Include="Themes\TheAdmin\Views\User.cshtml" />
<Content Include="Themes\TheAdmin\Views\Header.cshtml" />
<Content Include="Themes\Web.config" />
<Content Include="Themes\TheThemeMachine\Views\Layout.cshtml" />
<Content Include="Themes\TheThemeMachine\Views\Zone.cshtml" />
<Content Include="Themes\TheThemeMachine\Views\Zone-Sidebar.cshtml" />
<Content Include="Themes\TheThemeMachine\Views\Zone-Navigation.cshtml" />
<Content Include="Themes\TheThemeMachine\Views\Menu.cshtml" />
<None Include="Themes\TheThemeMachine\Views\Layout.cshtml" />
<None Include="Themes\TheThemeMachine\Views\Menu.cshtml">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />

View File

@@ -0,0 +1,19 @@
@using Orchard.Mvc.Html
@using Orchard.UI.Resources
@{
RegisterLink(new LinkEntry {Type = "image/x-icon", Rel = "shortcut icon", Href = Url.Content("~/modules/orchard.themes/Content/orchard.ico")});
}
<!DOCTYPE html>
<html lang="en" class="static @Html.ClassForPage()">
<head>
<meta charset="utf-8" />
<title>@Model.Title</title>
@Display(Model.Head)
<script>(function(d){d.className="dyn"+d.className.substring(6,d.className.length);})(document.documentElement);</script>
</head>
<body>
@// Layout (template) is in the Body zone @ the default position (nothing, zero, zilch)
@Display(Model.Body)
@Display(Model.Tail)
</body>
</html>

View File

@@ -1,34 +1,49 @@
@using Orchard.UI.Resources
@{
Style.Include("~/themes/Classic/styles/site.css");
Style.Include("~/themes/Classic/styles/blog.css");
}
<div id="wrapper">
@// HTML.Include will render a div with a class="user-display"
@// Can use this -> {Html.Include("User");}
@// or the following. At least they appear to do the same thing currently. The first is a standard Html.Include, the second "displays the (New) User shape"
@Display.User()
@// Top Navigation and branding
<div id="headercontainer">
<div id="header">
<h1>@WorkContext.CurrentSite.SiteName</h1>
<div class="menucontainer">
@Display(Model.Navigation)
</div>
<div class="clearBoth"></div>
</div>
</div>
@{
// cool stuff goes up here
var homeUrl = Href("~/");
<div id="main">
<div id="content">
@// Main Content
@Display(Model.Content)
// Zone is an alias for Display
Func<dynamic, dynamic> Zone = x => Display(x);
}
<div id="layout-wrapper">
<header id="layout-header">
@// needs to be the page title, not page (head) title...
<h1><a href="@homeUrl">@Model.Title</a></h1>
@if(Model.Header != null) {
<div id="header">
@Zone(Model.Header)
</div>
<div id="sidebar">
@Display(Model.search)
@Display(Model.sidebar)
}
@if(Model.Navigation != null) {
<div id="navigation">
@Zone(Model.Navigation)
</div>
@// End Content
@Display.Footer(Navigation:Model.Navigation)
}
</header>
@if(Model.Messages != null) {
<div id="messages">
@Zone(Model.Messages)
</div>
</div>
}
@if(Model.Featured != null) {
<div id="featured">
@Zone(Model.Featured)
</div>
}
@// the model content for the page is in the Content zone @ the default position (nothing, zero, zilch)
@if(Model.Content != null) {
<div id="content">
@Zone(Model.Content)
</div>
}
@if(Model.Sidebar != null) {
<aside>
@Zone(Model.Sidebar)
</aside>
}
@if(Model.Footer != null) {
<footer>
@Zone(Model.Footer)
</footer>
}
</div>

View File

@@ -1,13 +1,13 @@
<!-- Model is Model.Menu from the layout (Page.Menu) -->
<nav>
<ul>
<li class="first current"><a href="#">Home</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Full Page</a></li>
<li><a href="#">Image Page</a></li>
<li><a href="#">Gallery Page</a></li>
<li><a href="#">Nested Page</a></li>
<li class="last"><a href="#">Contact</a></li>
</ul>
@{
// these should move somewhere else
Model.Id = "menu-" + Model.MenuName.ToLower();
Model.Classes.Add(Model.Id);
Model.Classes.Add("menu");
var tag = Html.Resolve<Orchard.DisplayManagement.Shapes.ITagBuilderFactory>().Create(Model, "ul");
}
@tag.StartElement
@DisplayChildren(Model)
@tag.EndElement <!-- /@Model.Id -->
</nav>

View File

@@ -1,3 +0,0 @@
<div class="zone zone-@Model.ZoneName">
@Display...
</div>

View File

@@ -1,3 +0,0 @@
<div class="zone zone-@Model.ZoneName">
@Display...
</div>

View File

@@ -1,4 +0,0 @@

<div class="zone zone-@Model.ZoneName">
@Display...
</div>