mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
182 lines
6.1 KiB
Plaintext
182 lines
6.1 KiB
Plaintext
@functions {
|
|
string CalcuClassify(string[] zoneNames, string classNamePrefix)
|
|
{
|
|
var zoneCounter = 0;
|
|
var zoneNumsFilled = string.Join("", zoneNames.Select(zoneName => { ++zoneCounter; return Model[zoneName] != null ? zoneCounter.ToString() : "";}).ToArray());
|
|
return HasText(zoneNumsFilled) ? classNamePrefix + zoneNumsFilled : "";
|
|
}
|
|
}
|
|
@{
|
|
Style.Include("http://fonts.googleapis.com/css?family=Lobster&subset=latin");
|
|
Style.Include("site.css");
|
|
|
|
// cool stuff goes up here
|
|
var homeUrl = Href("~/");
|
|
|
|
// Zone is an alias for Display
|
|
Func<dynamic, dynamic> Zone = x => Display(x);
|
|
|
|
//Add classes to the wrapper div to toggle zones on and off
|
|
if (Model.AsideFirst != null && Model.AsideSecond == null) {
|
|
Model.Classes.Add("has-aside-one");
|
|
}
|
|
else if (Model.AsideFirst == null && Model.AsideSecond != null) {
|
|
Model.Classes.Add("has-aside-two");
|
|
}
|
|
else if (Model.AsideFirst != null && Model.AsideSecond != null) {
|
|
Model.Classes.Add("has-asides");
|
|
}
|
|
else {
|
|
|
|
}
|
|
|
|
// Debug Quad
|
|
// {WorkContext.Layout.FooterQuadSecond.Add("2 This is some test text to see if zones are working. This is some test text to see if zones are working.");}
|
|
// {WorkContext.Layout.FooterQuadFirst.Add("1 This is some test text to see if zones are working. This is some test text to see if zones are working.");}
|
|
// {WorkContext.Layout.FooterQuadThird.Add("3 This is some test text to see if zones are working. This is some test text to see if zones are working.");}
|
|
|
|
//Add classes to the wrapper div to toggle quad widget zones on and off
|
|
var tripelClass = CalcuClassify(new [] {"TripelFirst", "TripelSecond", "TripelThird"}, "tripel-");
|
|
if (HasText(tripelClass)) {
|
|
Model.Classes.Add(tripelClass);
|
|
}
|
|
|
|
//Add classes to the wrapper div to toggle quad widget zones on and off
|
|
var footerQuadClass = CalcuClassify(new [] {"FooterQuadFirst", "FooterQuadSecond", "FooterQuadThird", "FooterQuadFourth"}, "split-");
|
|
if (HasText(footerQuadClass)) {
|
|
Model.Classes.Add(footerQuadClass);
|
|
}
|
|
|
|
<span>debug: </span>
|
|
<span>tripelClass:@tripelClass</span><br />
|
|
<span>footerQuadClass:@footerQuadClass</span>
|
|
|
|
Model.Id = "layout-wrapper";
|
|
var tag = Tag (Model, "div");
|
|
|
|
// needs to be the page title, not page (head) title...
|
|
// Adds text and html to the header zone
|
|
using(Capture(branding => WorkContext.Layout.Header.Add(branding) )) {
|
|
<h1 id="branding"><a href="@homeUrl">@WorkContext.CurrentSite.SiteName</a></h1>
|
|
}
|
|
using(Capture(pbo => WorkContext.Layout.Footer.Add(pbo) )) {
|
|
<div class="credits"><span class="poweredby">Powered by <a href="http://www.orchardproject.net" title="Welcome to the New World Order" target="_blank">Orchard</a></span> <span class="copyright">© The Theme Machine 2010.</span></div>
|
|
}
|
|
|
|
WorkContext.Layout.Footer.Add(New.User());
|
|
}
|
|
|
|
@tag.StartElement
|
|
@if (Model.Header != null) {
|
|
<header id="layout-header" class="group">
|
|
<div id="header">
|
|
@Zone(Model.Header)
|
|
</div>
|
|
</header>
|
|
}
|
|
@if (Model.Navigation != null) {
|
|
<div id="layout-navigation" class="group">
|
|
@Zone(Model.Navigation)
|
|
</div>
|
|
}
|
|
@if (Model.Featered != null) {
|
|
<div id="layout-featured" class="group">
|
|
@Zone(Model.Featured)
|
|
</div>
|
|
}
|
|
@if (Model.BeforeMain != null) {
|
|
<div id="layout-before-main" class="group">
|
|
@Zone(Model.BeforeMain)
|
|
</div>
|
|
}
|
|
<div id="layout-main" class="group">
|
|
@if (Model.AsideFirst != null) {
|
|
<aside id="aside-first" class="aside-first">
|
|
@Zone(Model.AsideFirst)
|
|
</aside>
|
|
}
|
|
<div id="layout-content" class="group">
|
|
@if (Model.Messages != null) {
|
|
<div id="messages">
|
|
@Zone(Model.Messages)
|
|
</div>
|
|
}
|
|
@if (Model.BeforeContent != null) {
|
|
<div id="before-content">
|
|
@Zone(Model.BeforeContent)
|
|
</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" class="group">
|
|
@Zone(Model.Content)
|
|
</div>
|
|
}
|
|
@if (Model.AfterContent != null) {
|
|
<div id="after-content">
|
|
@Zone(Model.AfterContent)
|
|
</div>
|
|
}
|
|
</div>
|
|
@if (Model.AsideSecond != null) {
|
|
<aside id="aside-second" class="aside-second">
|
|
@Zone(Model.AsideSecond)
|
|
</aside>
|
|
}
|
|
</div>
|
|
@if (Model.AfterMain != null) {
|
|
<div id="layout-after-main" class="group">
|
|
@Zone(Model.AfterMain)
|
|
</div>
|
|
}
|
|
@if (Model.TripelFirst != null || Model.TripelSecond != null || Model.TripelThird != null) {
|
|
<div id="layout-tripel" class="group">@* as in beer *@
|
|
@if (Model.TripelFirst != null) {
|
|
<div id="tripel-first">
|
|
@Zone(Model.TripelFirst)
|
|
</div>
|
|
}
|
|
@if (Model.TripelSecond != null) {
|
|
<div id="tripel-second">
|
|
@Zone(Model.TripelSecond)
|
|
</div>
|
|
}
|
|
@if (Model.TripelThird != null) {
|
|
<div id="tripel-third">
|
|
@Zone(Model.TripelThird)
|
|
</div>
|
|
}
|
|
</div>
|
|
}
|
|
<div id="layout-footer" class="group">
|
|
<footer id="footer">
|
|
<div id="footer-quad" class="group">
|
|
@if (Model.FooterQuadFirst != null) {
|
|
<div id="footer-quad-first">
|
|
@Zone(Model.FooterQuadFirst)
|
|
</div>
|
|
}
|
|
@if (Model.FooterQuadSecond != null) {
|
|
<div id="footer-quad-second">
|
|
@Zone(Model.FooterQuadSecond)
|
|
</div>
|
|
}
|
|
@if (Model.FooterQuadThird != null) {
|
|
<div id="footer-quad-third">
|
|
@Zone(Model.FooterQuadThird)
|
|
</div>
|
|
}
|
|
@if (Model.FooterQuadFourth != null) {
|
|
<div id="footer-quad-fourth">
|
|
@Zone(Model.FooterQuadFourth)
|
|
</div>
|
|
}
|
|
</div>
|
|
@if(Model.Footer != null) {
|
|
<div id="footer-sig" class="group">
|
|
@Zone(Model.Footer)
|
|
</div>
|
|
}
|
|
</footer>
|
|
</div>
|
|
@tag.EndElement |