Some theme refinement (mainly around standardizing on zones and partials for the base "theme" and Orange and TheAdmin themes)

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044718
This commit is contained in:
skewed
2009-12-29 16:37:35 +00:00
parent 320b95ba4d
commit a074a6911b
13 changed files with 156 additions and 68 deletions

View File

@@ -140,6 +140,7 @@
<Content Include="Common\Views\EditorTemplates\Parts\Common.Owner.ascx" />
<Content Include="Themes\Styles\site.css" />
<Content Include="Themes\Views\Admin\Install.aspx" />
<Content Include="Themes\Views\header.ascx" />
<Content Include="Themes\Views\document.aspx" />
<Content Include="Themes\Views\EditorTemplates\Parts\Themes.SiteSettings.ascx" />
<Content Include="Themes\Views\layout.ascx" />

View File

@@ -332,6 +332,52 @@ div#title
font-size:95%;
}
/* Confirmations, Messages and the like
----------------------------------------------------------*/
.message, .validation-summary-errors {
margin:10px 0 4px 0;
padding:4px;
}
span.message {
display:block;
margin:4px 0 4px 4px;
}
.message a {
font-weight:bold;
}
.confirmation.message {
background:#e6f1c9; /* green */
border:1px solid #cfe493;
}
.warning.message {
background:#fdf5bc; /* yellow */
border:1px solid #ffea9b;
}
/* todo: (heskew) what else (other inputs) needs this? */
.critical.message, .validation-summary-errors,
.input-validation-error.text-box, .input-validation-error.text {
border:1px solid #990808;
}
.critical.message, .validation-summary-errors {
background:#e68585; /* red */
color:#fff;
}
.info.message {
background:#fff; /* orange :P */
border:1px dashed #D2D6C6;
}
.debug.message {
background:#eee;
border:1px dashed #D2D6C6;
color:#7a7a7a;
margin:20px 0 14px 0;
}
.debug.message:before {
content:"DEBUG » ";
}
/* Icon buttons
----------------------------------------------------------*/
a.ibutton, a.ibutton:link, a.ibutton:visited {

View File

@@ -0,0 +1,2 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<div id="title"><%=Html.TitleForPage(Html.SiteName()) %></div>

View File

@@ -1,17 +1,19 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BaseViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%><%
Html.RegisterStyle("site.css"); %>
<div class="page">
<div id="header">
<div id="title"><%=Html.TitleForPage(Html.SiteName()) %></div><%
Model.Zones.AddRenderPartial("header", "user", Model);
Html.Zone("header");
Html.RegisterStyle("site.css");
Model.Zones.AddRenderPartial("header", "header", Model);
Model.Zones.AddRenderPartial("header:after", "user", Model);
Model.Zones.AddRenderPartial("menu", "menu", Model);
Model.Zones.AddRenderPartial("content:before", "messages", Model.Messages);
%>
<div class="page">
<div id="header"><%
Html.Zone("header");
Html.Zone("menu"); %>
</div>
<div id="main"><%
Html.ZoneBody("content");
%> <div id="footer"><%
Html.ZoneBody("content"); %>
<div id="footer"><%
Html.Zone("footer");
%></div>
</div>

View File

@@ -172,7 +172,6 @@
<Content Include="Themes\TheAdmin\Theme.gif" />
<Content Include="Themes\TheAdmin\Theme.txt" />
<Content Include="Themes\TheAdmin\Views\layout.ascx" />
<Content Include="Themes\TheAdmin\Views\Shared\document.aspx" />
<Content Include="Views\Templates\ThreeColumns.aspx" />
<Content Include="Views\Templates\TwoColumns.aspx" />
</ItemGroup>
@@ -192,6 +191,9 @@
<Content Include="Themes\Green\Views\footer.ascx" />
<Content Include="Themes\Green\Views\layout.ascx" />
<Content Include="Themes\Green\Views\menu.ascx" />
<Content Include="Themes\TheAdmin\Views\menu.ascx" />
<Content Include="Themes\TheAdmin\Views\user.ascx" />
<Content Include="Themes\TheAdmin\Views\header.ascx" />
<Content Include="Themes\Web.config" />
</ItemGroup>
<ItemGroup>

View File

@@ -332,6 +332,52 @@ div#title
font-size:95%;
}
/* Confirmations, Messages and the like
----------------------------------------------------------*/
.message, .validation-summary-errors {
margin:10px 0 4px 0;
padding:4px;
}
span.message {
display:block;
margin:4px 0 4px 4px;
}
.message a {
font-weight:bold;
}
.confirmation.message {
background:#e6f1c9; /* green */
border:1px solid #cfe493;
}
.warning.message {
background:#fdf5bc; /* yellow */
border:1px solid #ffea9b;
}
/* todo: (heskew) what else (other inputs) needs this? */
.critical.message, .validation-summary-errors,
.input-validation-error.text-box, .input-validation-error.text {
border:1px solid #990808;
}
.critical.message, .validation-summary-errors {
background:#e68585; /* red */
color:#fff;
}
.info.message {
background:#fff; /* orange :P */
border:1px dashed #D2D6C6;
}
.debug.message {
background:#eee;
border:1px dashed #D2D6C6;
color:#7a7a7a;
margin:20px 0 14px 0;
}
.debug.message:before {
content:"DEBUG » ";
}
/* Icon buttons
----------------------------------------------------------*/
a.ibutton, a.ibutton:link, a.ibutton:visited {

View File

@@ -1,18 +1,19 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BaseViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%><%
Html.RegisterStyle("site.css"); %>
<div class="page">
<div id="header">
<div id="title"><%=Html.TitleForPage(Html.SiteName()) %></div><%
Model.Zones.AddRenderPartial("header", "user", Model);
Html.Zone("header");
Html.RegisterStyle("site.css");
Model.Zones.AddRenderPartial("header", "header", Model);
Model.Zones.AddRenderPartial("header:after", "user", Model);
Model.Zones.AddRenderPartial("menu", "menu", Model);
Model.Zones.AddRenderPartial("content:before", "messages", Model.Messages);
%>
<div class="page">
<div id="header"><%
Html.Zone("header");
Html.Zone("menu"); %>
</div>
<div id="main"><%
Model.Zones.AddRenderPartial("content:-1", "messages", Model.Messages);
Html.ZoneBody("content");
%> <div id="footer"><%
Html.ZoneBody("content"); %>
<div id="footer"><%
Html.Zone("footer");
%></div>
</div>

View File

@@ -1,14 +0,0 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BaseViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Mvc.Html"
%><!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title><%=Html.Title() %></title><%
Html.Zone("head", ":metas :styles :scripts"); %>
</head>
<body><%
Html.ZoneBody("body"); %>
</body>
</html>

View File

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

View File

@@ -1,41 +1,16 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<AdminViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Mvc.Html"%>
<%
Html.RegisterStyle("site.css"); %>
<div id="header" role="banner">
<h1><%=Html.ActionLink("Project Orchard", "Index", new { Area = "", Controller = "Home" })%></h1>
<div id="site"><%=Html.ActionLink("Your Site", "Index", new { Area = "", Controller = "Home" })%></div>
<% if (Model.CurrentUser != null) { //todo: (heskew) localize the string format "User: <username> | a:logoff"
%><div id="login"><%="User"%>: <%=Html.Encode(Model.CurrentUser.UserName)%> | <%=Html.ActionLink("Logout", "LogOff", new { Area = "", Controller = "Account" }) %></div><%
} %>
</div>
<div id="content">
<div id="navshortcut"><a href="#navigation"><%="Skip to navigation" %></a></div>
<div id="main" role="main">
<div class="wrapper">
<% Html.RenderPartial("Messages", Model.Messages); %>
</div><%
Html.ZoneBody("content");
%> </div>
<ul id="navigation" role="navigation">
<li class="first"><h4><span>Dashboard</span></h4></li>
<%if (Model.AdminMenu != null) {
foreach (var menuSection in Model.AdminMenu) {
// todo: (heskew) need some help(er)
var firstSectionItem = menuSection.Items.FirstOrDefault();
var sectionHeaderMarkup = firstSectionItem != null
? Html.ActionLink(menuSection.Text, (string)firstSectionItem.RouteValues["action"], firstSectionItem.RouteValues).ToHtmlString()
: string.Format("<span>{0}</span>", Html.Encode(menuSection.Text));
<%@ Import Namespace="Orchard.Mvc.Html"%><%
Html.RegisterStyle("site.css");
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);
Model.Zones.AddRenderPartial("content:before", "messages", Model.Messages);
%>
<li><h4><%=sectionHeaderMarkup%></h4><ul><%foreach (var menuItem in menuSection.Items) { %>
<li><%=Html.ActionLink(menuItem.Text, (string)menuItem.RouteValues["action"], menuItem.RouteValues)%></li>
<%} %></ul></li>
<%
}
}%>
</ul>
<div id="header" role="banner"><% Html.Zone("header"); %></div>
<div id="content">
<div id="navshortcut"><a href="#menu"><%="Skip to navigation" %></a></div>
<div id="main" role="main"><% Html.ZoneBody("content"); %></div>
<div id="menu"><% Html.Zone("menu"); %></div>
</div>
<div id="footer" role="contentinfo"><%
Html.Zone("footer");
%></div>
<div id="footer" role="contentinfo"><% Html.Zone("footer"); %></div>

View File

@@ -0,0 +1,19 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<AdminViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<ul id="navigation" role="navigation">
<li class="first"><h4><span>Dashboard</span></h4></li>
<%if (Model.AdminMenu != null) {
foreach (var menuSection in Model.AdminMenu) {
// todo: (heskew) need some help(er)
var firstSectionItem = menuSection.Items.FirstOrDefault();
var sectionHeaderMarkup = firstSectionItem != null
? Html.ActionLink(menuSection.Text, (string)firstSectionItem.RouteValues["action"], firstSectionItem.RouteValues).ToHtmlString()
: string.Format("<span>{0}</span>", Html.Encode(menuSection.Text));
%>
<li><h4><%=sectionHeaderMarkup%></h4><ul><%foreach (var menuItem in menuSection.Items) { %>
<li><%=Html.ActionLink(menuItem.Text, (string)menuItem.RouteValues["action"], menuItem.RouteValues)%></li>
<%} %></ul></li>
<%
}
}%>
</ul>

View File

@@ -0,0 +1,5 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<AdminViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<% if (Model.CurrentUser != null) { //todo: (heskew) localize the string format "User: <username> | a:logoff"
%><div id="login"><%="User"%>: <%=Html.Encode(Model.CurrentUser.UserName)%> | <%=Html.ActionLink("Logout", "LogOff", new { Area = "", Controller = "Account" }) %></div><%
} %>

View File

@@ -2,7 +2,6 @@
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<h2><%=Html.TitleForPage("Log On") %></h2>
<p>Please enter your username and password. <%= Html.ActionLink("Register", "Register") %> if you don't have an account.</p>
<% if (Model != null && Model.Messages != null) Html.RenderPartial("Messages", Model.Messages); %>
<%= Html.ValidationSummary("Login was unsuccessful. Please correct the errors and try again.") %>
<% using (Html.BeginFormAntiForgeryPost()) { %>