UI cleanup pass (progress - Themes module and TheAdmin theme)

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4045044
This commit is contained in:
skewed
2010-01-06 08:08:08 +00:00
parent 79bfc390f3
commit e8b1e2c294
19 changed files with 17092 additions and 83 deletions

View File

@@ -141,11 +141,16 @@
<Content Include="Common\Views\EditorTemplates\Parts\Common.Body.ascx" /> <Content Include="Common\Views\EditorTemplates\Parts\Common.Body.ascx" />
<Content Include="Common\Views\EditorTemplates\Parts\Common.Owner.ascx" /> <Content Include="Common\Views\EditorTemplates\Parts\Common.Owner.ascx" />
<Content Include="Settings\Views\EditorTemplates\Items\Settings.Site.ascx" /> <Content Include="Settings\Views\EditorTemplates\Items\Settings.Site.ascx" />
<Content Include="Themes\Scripts\jquery-1.3.2-vsdoc.js" />
<Content Include="Themes\Scripts\jquery-1.3.2.js" />
<Content Include="Themes\Scripts\jquery-1.3.2.min-vsdoc.js" />
<Content Include="Themes\Scripts\jquery-1.3.2.min.js" />
<Content Include="Themes\Styles\site.css" /> <Content Include="Themes\Styles\site.css" />
<Content Include="Themes\Views\Admin\Install.aspx" /> <Content Include="Themes\Views\Admin\Install.aspx" />
<Content Include="Themes\Views\header.ascx" /> <Content Include="Themes\Views\header.ascx" />
<Content Include="Themes\Views\document.aspx" /> <Content Include="Themes\Views\document.aspx" />
<Content Include="Themes\Views\EditorTemplates\Parts\Themes.SiteSettings.ascx" /> <Content Include="Themes\Views\EditorTemplates\Parts\Themes.SiteSettings.ascx" />
<Content Include="Themes\Views\HeadPreload.ascx" />
<Content Include="Themes\Views\layout.ascx" /> <Content Include="Themes\Views\layout.ascx" />
<Content Include="Themes\Views\messages.ascx" /> <Content Include="Themes\Views\messages.ascx" />
<Content Include="Themes\Views\user.ascx" /> <Content Include="Themes\Views\user.ascx" />

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,31 +1,34 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<ThemesIndexViewModel>" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<ThemesIndexViewModel>" %>
<%@ Import Namespace="Orchard.Core.Themes.ViewModels"%> <%@ Import Namespace="Orchard.Core.Themes.ViewModels"%>
<h2><%=Html.TitleForPage("Manage Themes") %></h2> <h1><%=Html.TitleForPage("Manage Themes") %></h1>
<h3>Current Theme</h3> <h2><%=_Encoded("Current Theme")%></h2>
<% if (Model.CurrentTheme == null) { <% if (Model.CurrentTheme == null) {
%><p>There is no current theme in the application. The built-in theme will be used.<br /><%=Html.ActionLink("Install a new Theme", "Install") %></p><% %><p><%=_Encoded("There is no current theme in the application. The built-in theme will be used.")
%><br /><%=Html.ActionLink(T("Install a new Theme").ToString(), "Install") %></p><%
} else { } else {
%><h4><%= Model.CurrentTheme.DisplayName %></h4> %><h3><%=Html.Encode(Model.CurrentTheme.DisplayName) %></h3>
<p><img src="<%= ResolveUrl("~/Themes/" + Model.CurrentTheme.ThemeName + "/Theme.gif")%>" alt="<%= Model.CurrentTheme.DisplayName %>" /><br /> <p>
By <%= Model.CurrentTheme.Author %><br /> <%=Html.Image(ResolveUrl("~/Themes/" + Model.CurrentTheme.ThemeName + "/Theme.gif"), Html.Encode(Model.CurrentTheme.DisplayName), null) %><br />
<%= Model.CurrentTheme.Version %><br /> <%=_Encoded("By") %> <%=Html.Encode(Model.CurrentTheme.Author) %><br />
<%= Model.CurrentTheme.Description %><br /> <%=Html.Encode(Model.CurrentTheme.Version) %><br />
<%= Model.CurrentTheme.HomePage %><br /> <%=Html.Encode(Model.CurrentTheme.Description) %><br />
<%=Html.ActionLink("Install a new Theme", "Install") %> <%=Html.Encode(Model.CurrentTheme.HomePage) %><br />
<%=Html.ActionLink(T("Install a new Theme").ToString(), "Install") %>
</p> </p>
<% } %> <% } %>
<h3>Available Themes</h3> <h2><%=_Encoded("Available Themes")%></h2>
<ul class="templates"> <ul class="templates">
<% foreach (var theme in Model.Themes) { <% foreach (var theme in Model.Themes) {
if (Model.CurrentTheme == null || theme.ThemeName != Model.CurrentTheme.ThemeName) { if (Model.CurrentTheme == null || theme.ThemeName != Model.CurrentTheme.ThemeName) {
%> <li> %> <li>
<h4><%= theme.DisplayName %> </h4> <h3><%=Html.Encode(theme.DisplayName) %></h3>
<p><img src="<%= ResolveUrl("~/Themes/" + theme.ThemeName + "/Theme.gif") %>" alt="<%= theme.DisplayName %>" /><br /> <p>
By <%= theme.Author %><br /> <%=Html.Image(ResolveUrl("~/Themes/" + theme.ThemeName + "/Theme.gif"), Html.Encode(theme.DisplayName), null) %><br />
<%= theme.Version %><br /> <%=_Encoded("By") %> <%=Html.Encode(theme.Author) %><br />
<%= theme.Description %><br /> <%=Html.Encode(theme.Version) %><br />
<%= theme.HomePage %><br /> <%=Html.Encode(theme.Description) %><br />
<%=Html.ActionLink("Activate", "Activate", new {themeName = theme.ThemeName}) %> | <%=Html.ActionLink("Uninstall", "Uninstall", new {themeName = theme.ThemeName}) %> <%=Html.Encode(theme.HomePage) %><br />
<%=Html.ActionLink(T("Activate").ToString(), "Activate", new {themeName = theme.ThemeName}) %> | <%=Html.ActionLink(T("Uninstall").ToString(), "Uninstall", new {themeName = theme.ThemeName}) %>
</p> </p>
</li> </li>
<% } <% }

View File

@@ -1,11 +1,11 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %> <%@ Page Language="C#" Inherits="Orchard.Mvc.ViewPage<object>" %>
<h2><%=Html.TitleForPage("Install Theme") %></h2> <h2><%=Html.TitleForPage("Install Theme") %></h2>
<% using (Html.BeginForm("Install", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) {%> <% using (Html.BeginForm("Install", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) {%>
<%=Html.ValidationSummary() %> <%=Html.ValidationSummary() %>
<fieldset> <fieldset>
<label for="pageTitle">File Path to the zip file:</label> <label for="ThemeZipPath"><%=_Encoded("File Path to the zip file:")%></label>
<input id="ThemeZipPath" name="ThemeZipPath" type="file" class="text" value="Browse" size="64"/><br /> <input id="ThemeZipPath" name="ThemeZipPath" type="file" class="text" value="<%=_Encoded("Browse") %>" size="64" /><br />
<input type="submit" class="button" value="Install" /> <input type="submit" class="button" value="<%=_Encoded("Install") %>" />
<%=Html.AntiForgeryTokenOrchard() %> <%=Html.AntiForgeryTokenOrchard() %>
</fieldset> </fieldset>
<% } %> <% } %>

View File

@@ -1,10 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ThemeSiteSettingsRecord>" %> <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ThemeSiteSettingsRecord>" %>
<%@ Import Namespace="Orchard.Core.Themes.Records"%> <%@ Import Namespace="Orchard.Core.Themes.Records"%>
<h3>Themes</h3> <fieldset>
<ol> <legend><%=_Encoded("Themes")%></legend>
<li> <fieldset>
<%= Html.LabelFor(x=>x.CurrentThemeName) %> <%= Html.LabelFor(x=>x.CurrentThemeName) %>
<%= Html.EditorFor(x=>x.CurrentThemeName) %> <%= Html.EditorFor(x=>x.CurrentThemeName) %>
<%= Html.ValidationMessage("CurrentThemeName", "*")%> <%= Html.ValidationMessage("CurrentThemeName", "*")%>
</li> </fieldset>
</ol> </fieldset>

View File

@@ -0,0 +1,2 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<% Html.RegisterScript("jquery-1.3.2.js"); // <- change to .min.js for use on a real site :) %>

View File

@@ -1,12 +1,15 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BaseViewModel>" %> <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<BaseViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%> <%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Mvc.Html" <%@ Import Namespace="Orchard.Mvc.Html"
%><!DOCTYPE html> %><!DOCTYPE html>
<html> <html lang="en" class="static">
<head> <head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title><%=Html.Title() %></title><% <title><%=Html.Title() %></title><%
//todo: (heskew) have resource modules that can be leaned on (like a jQuery module that knows about various CDNs and jQuery's version and min naming schemes)
//todo: (heskew) this is an interim solution to inlude jQuery in every page and still allow that to be overriden in some theme by it containing a headScripts partial
Model.Zones.AddRenderPartial("head:before", "HeadPreload", Model);
Html.Zone("head", ":metas :styles :scripts"); %> Html.Zone("head", ":metas :styles :scripts"); %>
<script type="text/javascript">window.document.documentElement.className="dyn"</script>
</head> </head>
<body><% <body><%
Html.ZoneBody("body"); %> Html.ZoneBody("body"); %>

View File

@@ -1,9 +1,9 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<object>" %>
<div id="menucontainer"> <div id="menucontainer">
<ul id="menu"> <ul id="menu">
<li><%= Html.ActionLink("Home", "Index", "Home", new {Area = ""}, new {})%></li> <li><%= Html.ActionLink(T("Home").ToString(), "Index", "Home", new {Area = ""}, new {})%></li>
<li><%= Html.ActionLink("About", "About", "Home", new {Area = ""}, new {})%></li> <li><%= Html.ActionLink(T("About").ToString(), "About", "Home", new { Area = "" }, new { })%></li>
<li><%= Html.ActionLink("Blogs", "List", "Blog", new {Area = "Orchard.Blogs"}, new {})%></li> <li><%= Html.ActionLink(T("Blogs").ToString(), "List", "Blog", new { Area = "Orchard.Blogs" }, new { })%></li>
<li><%= Html.ActionLink("Admin", "List", new {Area = "Orchard.Blogs", Controller = "BlogAdmin"})%></li> <li><%= Html.ActionLink(T("Admin").ToString(), "List", new { Area = "Orchard.Blogs", Controller = "BlogAdmin" })%></li>
</ul> </ul>
</div> </div>

View File

@@ -1,16 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<NotifyEntry>>" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<NotifyEntry>>" %>
<%@ Import Namespace="Orchard.UI.Notify"%> <%@ Import Namespace="Orchard.UI.Notify"%>
<%-- todo: (heskew) not this --%> <% foreach (var item in Model) {
<script runat="server"> var className = item.Type == NotifyType.Error
string CssClassName(NotifyType type) { ? "critical"
switch(type) { : item.Type == NotifyType.Warning
case NotifyType.Error: ? "warning"
return "critical"; : "info"; %>
case NotifyType.Warning: <div class="<%=className %> message"><%=Html.Encode(item.Message) %></div>
return "warning";
}
return "info";
}</script>
<% foreach (var item in Model) { %>
<div class="<%=CssClassName(item.Type) %> message"><%=Html.Encode(item.Message) %></div>
<% } %> <% } %>

View File

@@ -1,9 +1,9 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<object>" %>
<div id="logindisplay"> <div id="logindisplay">
<% if (Request.IsAuthenticated) { %> <% if (Request.IsAuthenticated) { %>
Welcome <strong><%=Html.Encode(Page.User.Identity.Name) %></strong>! <%=_Encoded("Welcome")%> <strong><%=Html.Encode(Page.User.Identity.Name) %></strong>!
[<%=Html.ActionLink("Log Off", "LogOff", new { Controller = "Account", Area = "Orchard.Users" })%>] [<%=Html.ActionLink(T("Log Off").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users" })%>]
<% } else { %> <% } else { %>
[<%=Html.ActionLink("Log On", "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })%>] [<%=Html.ActionLink(T("Log On").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })%>]
<% } %> <% } %>
</div> </div>

View File

@@ -143,12 +143,12 @@ h1, h2, h3, h4, h5, legend {
font-style: normal; font-style: normal;
font-weight:normal; font-weight:normal;
} }
h1 { font-size:2.8em; } /* 28px */ h1 { font-size:2.4em; } /* 24px */
h2 { font-size:2.4em; } /* 24px */ h2 { font-size:2.1em; } /* 21px */
h3 { font-size:2.1em; } /* 21px */ h2 span { font-size:.57em; } /* 12px */
h3 span { font-size:.57em; } /* 12px */ h3 { font-size:1.8em; } /* 18px */
h4 { font-size:1.8em; } /* 18px */ h4 { font-size:1.6em; } /* 16px */
h5 { font-size:1.6em; } /* 16px */ h5 { font-size:1.4em; } /* 14px */
h6, p, legend, label, input, select, .button, h6, p, legend, label, input, select, .button,
.message, .validation-summary-errors, .message, .validation-summary-errors,
@@ -176,10 +176,12 @@ a:hover, a:active, a:focus {
background:#8a8f7a url(images/background_header.jpg) no-repeat bottom right; background:#8a8f7a url(images/background_header.jpg) no-repeat bottom right;
height:60px; height:60px;
} }
#header h1 { #header #app {
float:left; float:left;
font-size:2.4em;
padding:.4em 0;
} }
#header h1 a { #header #app a {
background:url(images/orchardLogo.jpg) no-repeat; background:url(images/orchardLogo.jpg) no-repeat;
display:block; display:block;
height:60px; height:60px;
@@ -230,18 +232,18 @@ a:hover, a:active, a:focus {
border:0; border:0;
margin:0; margin:0;
} }
#navigation li h4 { #navigation li h3 {
padding:0; padding:0;
} }
#navigation li h4 a, #navigation li h4 span { #navigation li h3 a, #navigation li h3 span {
background:#dddfcb url(images/tableHeaderBackground.gif) repeat-x top left; background:#dddfcb url(images/tableHeaderBackground.gif) repeat-x top left;
display:block; display:block;
padding:6px 4px 8px 8px; padding:6px 4px 8px 8px;
} }
#navigation li h4 a, #navigation li h4 a:link, #navigation li h4 a:visited { #navigation li h3 a, #navigation li h3 a:link, #navigation li h3 a:visited {
color:inherit; color:inherit;
} }
#navigation li h4 a:hover, #navigation li h4 a:active, #navigation li h4 a:focus { #navigation li h3 a:hover, #navigation li h3 a:active, #navigation li h3 a:focus {
background:#8a8f7a; background:#8a8f7a;
color:#f6faea; color:#f6faea;
text-decoration:none; text-decoration:none;
@@ -264,10 +266,10 @@ a:hover, a:active, a:focus {
/* Content /* Content
----------------------------------------------------------*/ ----------------------------------------------------------*/
#main h2 { #main h1 {
margin:.23em 0 1em; margin:.23em 0 1em;
} }
#main h3, #main h4 { #main h2, #main h3 {
margin:.5em 0; margin:.5em 0;
} }
#main p { #main p {
@@ -282,10 +284,10 @@ a:hover, a:active, a:focus {
#main form { #main form {
margin:.345em 0 1.5em; margin:.345em 0 1.5em;
} }
#main h2 { #main h1 {
border-bottom:1px dashed #e4e7dc; border-bottom:1px dashed #e4e7dc;
} }
#main h3 { #main h2 {
border-bottom:1px solid #e4e7dc; border-bottom:1px solid #e4e7dc;
} }

View File

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

View File

@@ -1,4 +1,4 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<AdminViewModel>" %> <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<AdminViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.ViewModels"%> <%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Mvc.Html"%><% <%@ Import Namespace="Orchard.Mvc.Html"%><%
Html.RegisterStyle("site.css"); Html.RegisterStyle("site.css");
@@ -9,7 +9,7 @@ Model.Zones.AddRenderPartial("content:before", "messages", Model.Messages);
%> %>
<div id="header" role="banner"><% Html.Zone("header"); %></div> <div id="header" role="banner"><% Html.Zone("header"); %></div>
<div id="content"> <div id="content">
<div id="navshortcut"><a href="#menu"><%="Skip to navigation" %></a></div> <div id="navshortcut"><a href="#menu"><%=_Encoded("Skip to navigation") %></a></div>
<div id="main" role="main"><% Html.ZoneBody("content"); %></div> <div id="main" role="main"><% Html.ZoneBody("content"); %></div>
<div id="menu"><% Html.Zone("menu"); %></div> <div id="menu"><% Html.Zone("menu"); %></div>
</div> </div>

View File

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

View File

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

View File

@@ -123,6 +123,33 @@ namespace Orchard.Mvc.Html {
#endregion #endregion
#region Image
public static MvcHtmlString Image(this HtmlHelper htmlHelper, string src, string alt, object htmlAttributes) {
return htmlHelper.Image(src, alt, new RouteValueDictionary(htmlAttributes));
}
public static MvcHtmlString Image(this HtmlHelper htmlHelper, string src, string alt, IDictionary<string, object> htmlAttributes) {
UrlHelper url = new UrlHelper(htmlHelper.ViewContext.RequestContext);
string imageUrl = url.Content(src);
TagBuilder imageTag = new TagBuilder("img");
if (!string.IsNullOrEmpty(imageUrl))
imageTag.MergeAttribute("src", imageUrl);
if (!string.IsNullOrEmpty(alt))
imageTag.MergeAttribute("alt", alt);
imageTag.MergeAttributes(htmlAttributes, true);
if (imageTag.Attributes.ContainsKey("alt") && !imageTag.Attributes.ContainsKey("title"))
imageTag.MergeAttribute("title", imageTag.Attributes["alt"] ?? "");
return MvcHtmlString.Create(imageTag.ToString(TagRenderMode.SelfClosing));
}
#endregion
#region Link #region Link
public static string Link(this HtmlHelper htmlHelper, string linkContents, string href) public static string Link(this HtmlHelper htmlHelper, string linkContents, string href)