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.Owner.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\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\HeadPreload.ascx" />
<Content Include="Themes\Views\layout.ascx" />
<Content Include="Themes\Views\messages.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"%>
<h2><%=Html.TitleForPage("Manage Themes") %></h2>
<h3>Current Theme</h3>
<h1><%=Html.TitleForPage("Manage Themes") %></h1>
<h2><%=_Encoded("Current Theme")%></h2>
<% 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 {
%><h4><%= Model.CurrentTheme.DisplayName %></h4>
<p><img src="<%= ResolveUrl("~/Themes/" + Model.CurrentTheme.ThemeName + "/Theme.gif")%>" alt="<%= Model.CurrentTheme.DisplayName %>" /><br />
By <%= Model.CurrentTheme.Author %><br />
<%= Model.CurrentTheme.Version %><br />
<%= Model.CurrentTheme.Description %><br />
<%= Model.CurrentTheme.HomePage %><br />
<%=Html.ActionLink("Install a new Theme", "Install") %>
%><h3><%=Html.Encode(Model.CurrentTheme.DisplayName) %></h3>
<p>
<%=Html.Image(ResolveUrl("~/Themes/" + Model.CurrentTheme.ThemeName + "/Theme.gif"), Html.Encode(Model.CurrentTheme.DisplayName), null) %><br />
<%=_Encoded("By") %> <%=Html.Encode(Model.CurrentTheme.Author) %><br />
<%=Html.Encode(Model.CurrentTheme.Version) %><br />
<%=Html.Encode(Model.CurrentTheme.Description) %><br />
<%=Html.Encode(Model.CurrentTheme.HomePage) %><br />
<%=Html.ActionLink(T("Install a new Theme").ToString(), "Install") %>
</p>
<% } %>
<h3>Available Themes</h3>
<h2><%=_Encoded("Available Themes")%></h2>
<ul class="templates">
<% foreach (var theme in Model.Themes) {
if (Model.CurrentTheme == null || theme.ThemeName != Model.CurrentTheme.ThemeName) {
%><li>
<h4><%= theme.DisplayName %> </h4>
<p><img src="<%= ResolveUrl("~/Themes/" + theme.ThemeName + "/Theme.gif") %>" alt="<%= theme.DisplayName %>" /><br />
By <%= theme.Author %><br />
<%= theme.Version %><br />
<%= theme.Description %><br />
<%= theme.HomePage %><br />
<%=Html.ActionLink("Activate", "Activate", new {themeName = theme.ThemeName}) %> | <%=Html.ActionLink("Uninstall", "Uninstall", new {themeName = theme.ThemeName}) %>
%> <li>
<h3><%=Html.Encode(theme.DisplayName) %></h3>
<p>
<%=Html.Image(ResolveUrl("~/Themes/" + theme.ThemeName + "/Theme.gif"), Html.Encode(theme.DisplayName), null) %><br />
<%=_Encoded("By") %> <%=Html.Encode(theme.Author) %><br />
<%=Html.Encode(theme.Version) %><br />
<%=Html.Encode(theme.Description) %><br />
<%=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>
</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>
<% using (Html.BeginForm("Install", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) {%>
<%= Html.ValidationSummary() %>
<%=Html.ValidationSummary() %>
<fieldset>
<label for="pageTitle">File Path to the zip file:</label>
<input id="ThemeZipPath" name="ThemeZipPath" type="file" class="text" value="Browse" size="64"/><br />
<input type="submit" class="button" value="Install" />
<label for="ThemeZipPath"><%=_Encoded("File Path to the zip file:")%></label>
<input id="ThemeZipPath" name="ThemeZipPath" type="file" class="text" value="<%=_Encoded("Browse") %>" size="64" /><br />
<input type="submit" class="button" value="<%=_Encoded("Install") %>" />
<%=Html.AntiForgeryTokenOrchard() %>
</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"%>
<h3>Themes</h3>
<ol>
<li>
<fieldset>
<legend><%=_Encoded("Themes")%></legend>
<fieldset>
<%= Html.LabelFor(x=>x.CurrentThemeName) %>
<%= Html.EditorFor(x=>x.CurrentThemeName) %>
<%= Html.ValidationMessage("CurrentThemeName", "*")%>
</li>
</ol>
</fieldset>
</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.Html"
%><!DOCTYPE html>
<html>
<html lang="en" class="static">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<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"); %>
<script type="text/javascript">window.document.documentElement.className="dyn"</script>
</head>
<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">
<ul id="menu">
<li><%= Html.ActionLink("Home", "Index", "Home", new {Area = ""}, new {})%></li>
<li><%= Html.ActionLink("About", "About", "Home", new {Area = ""}, new {})%></li>
<li><%= Html.ActionLink("Blogs", "List", "Blog", new {Area = "Orchard.Blogs"}, new {})%></li>
<li><%= Html.ActionLink("Admin", "List", new {Area = "Orchard.Blogs", Controller = "BlogAdmin"})%></li>
<li><%= Html.ActionLink(T("Home").ToString(), "Index", "Home", new {Area = ""}, new {})%></li>
<li><%= Html.ActionLink(T("About").ToString(), "About", "Home", new { Area = "" }, new { })%></li>
<li><%= Html.ActionLink(T("Blogs").ToString(), "List", "Blog", new { Area = "Orchard.Blogs" }, new { })%></li>
<li><%= Html.ActionLink(T("Admin").ToString(), "List", new { Area = "Orchard.Blogs", Controller = "BlogAdmin" })%></li>
</ul>
</div>

View File

@@ -1,16 +1,10 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<NotifyEntry>>" %>
<%@ Import Namespace="Orchard.UI.Notify"%>
<%-- todo: (heskew) not this --%>
<script runat="server">
string CssClassName(NotifyType type) {
switch(type) {
case NotifyType.Error:
return "critical";
case NotifyType.Warning:
return "warning";
}
return "info";
}</script>
<% foreach (var item in Model) { %>
<div class="<%=CssClassName(item.Type) %> message"><%=Html.Encode(item.Message) %></div>
<% foreach (var item in Model) {
var className = item.Type == NotifyType.Error
? "critical"
: item.Type == NotifyType.Warning
? "warning"
: "info"; %>
<div class="<%=className %> 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">
<% if (Request.IsAuthenticated) { %>
Welcome <strong><%=Html.Encode(Page.User.Identity.Name) %></strong>!
[<%=Html.ActionLink("Log Off", "LogOff", new { Controller = "Account", Area = "Orchard.Users" })%>]
<%=_Encoded("Welcome")%> <strong><%=Html.Encode(Page.User.Identity.Name) %></strong>!
[<%=Html.ActionLink(T("Log Off").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users" })%>]
<% } 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>

View File

@@ -143,12 +143,12 @@ h1, h2, h3, h4, h5, legend {
font-style: normal;
font-weight:normal;
}
h1 { font-size:2.8em; } /* 28px */
h2 { font-size:2.4em; } /* 24px */
h3 { font-size:2.1em; } /* 21px */
h3 span { font-size:.57em; } /* 12px */
h4 { font-size:1.8em; } /* 18px */
h5 { font-size:1.6em; } /* 16px */
h1 { font-size:2.4em; } /* 24px */
h2 { font-size:2.1em; } /* 21px */
h2 span { font-size:.57em; } /* 12px */
h3 { font-size:1.8em; } /* 18px */
h4 { font-size:1.6em; } /* 16px */
h5 { font-size:1.4em; } /* 14px */
h6, p, legend, label, input, select, .button,
.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;
height:60px;
}
#header h1 {
#header #app {
float:left;
font-size:2.4em;
padding:.4em 0;
}
#header h1 a {
#header #app a {
background:url(images/orchardLogo.jpg) no-repeat;
display:block;
height:60px;
@@ -230,18 +232,18 @@ a:hover, a:active, a:focus {
border:0;
margin:0;
}
#navigation li h4 {
#navigation li h3 {
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;
display:block;
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;
}
#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;
color:#f6faea;
text-decoration:none;
@@ -264,10 +266,10 @@ a:hover, a:active, a:focus {
/* Content
----------------------------------------------------------*/
#main h2 {
#main h1 {
margin:.23em 0 1em;
}
#main h3, #main h4 {
#main h2, #main h3 {
margin:.5em 0;
}
#main p {
@@ -282,10 +284,10 @@ a:hover, a:active, a:focus {
#main form {
margin:.345em 0 1.5em;
}
#main h2 {
#main h1 {
border-bottom:1px dashed #e4e7dc;
}
#main h3 {
#main h2 {
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"%>
<h1><%=Html.ActionLink("Project Orchard", "Index", new { Area = "", Controller = "Home" })%></h1>
<div id="site"><%=Html.ActionLink("Your Site", "Index", new { Area = "", Controller = "Home" })%></div>
<div id="app"><%=Html.ActionLink(T("Project Orchard").ToString(), "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.Html"%><%
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="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="menu"><% Html.Zone("menu"); %></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"%>
<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) {
foreach (var menuSection in Model.AdminMenu) {
// todo: (heskew) need some help(er)
@@ -10,7 +10,7 @@
? 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><h3><%=sectionHeaderMarkup %></h3><ul><%foreach (var menuItem in menuSection.Items) { %>
<li><%=Html.ActionLink(menuItem.Text, (string)menuItem.RouteValues["action"], menuItem.RouteValues)%></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"%>
<% 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 = "Orchard.Users", Controller = "Account" }) %></div><%
<% if (Model.CurrentUser != null) {
%><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
#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
public static string Link(this HtmlHelper htmlHelper, string linkContents, string href)