Theme management UI updates and bug fixes

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-05-14 13:43:41 -07:00
parent 6e023c01b3
commit a24b9eb732
4 changed files with 68 additions and 43 deletions

View File

@@ -50,10 +50,10 @@ jQuery.fn.extend({
(function() { (function() {
$("form.inline.link").each(function() { $("form.inline.link").each(function() {
var _this = $(this); var _this = $(this);
var link = $("<a href='.'/>"); var link = $("<a class='wasFormInlineLink' href='.'/>");
var button = _this.children("button").first(); var button = _this.children("button").first();
link.text(button.text()) link.text(button.text())
.css("cursor", "pointer") .addClass(button.attr("class"))
.click(function() { _this.submit(); return false; }) .click(function() { _this.submit(); return false; })
.unload(function() { _this = 0; }); .unload(function() { _this = 0; });
_this.replaceWith(link); _this.replaceWith(link);

View File

@@ -27,33 +27,24 @@
<div> <div>
<h3><%=Html.Encode(theme.DisplayName) %></h3> <h3><%=Html.Encode(theme.DisplayName) %></h3>
<%=Html.Image(Html.ThemePath(theme, "/Theme.png"), Html.Encode(theme.DisplayName), null)%> <%=Html.Image(Html.ThemePath(theme, "/Theme.png"), Html.Encode(theme.DisplayName), null)%>
<% using (Html.BeginFormAntiForgeryPost(Url.Action("Activate"), FormMethod.Post, new { @class = "inline" })) { %>
<% using (Html.BeginFormAntiForgeryPost(Url.Action("Activate"), FormMethod.Post, new { @class = "inline" })) <%=Html.Hidden("themeName", theme.ThemeName)%>
{ %> <button type="submit" title="<%=_Encoded("Activate") %>"><%=_Encoded("Activate") %></button>
<fieldset> <% } %>
<button type="submit" title="<%=_Encoded("Activate") %>" name="themeName" value="<%=theme.ThemeName %>"><%=_Encoded("Activate") %></button> <% using (Html.BeginFormAntiForgeryPost(Url.Action("Preview"), FormMethod.Post, new { @class = "inline" })) { %>
</fieldset> <%=Html.Hidden("themeName", theme.ThemeName)%>
<% } %> <button type="submit" title="<%=_Encoded("Preview") %>"><%=_Encoded("Preview") %></button>
<% using (Html.BeginFormAntiForgeryPost(Url.Action("Preview"), FormMethod.Post, new { @class = "inline" })) <% } %>
{ %>
<fieldset>
<button type="submit" title="<%=_Encoded("Preview") %>" name="themeName" value="<%=theme.ThemeName %>"><%=_Encoded("Preview") %></button>
</fieldset>
<% } %>
<h5><%=_Encoded("By") %> <%=Html.Encode(theme.Author) %></h5> <h5><%=_Encoded("By") %> <%=Html.Encode(theme.Author) %></h5>
<p> <p>
<%=_Encoded("Version:") %> <%=Html.Encode(theme.Version) %><br /> <%=_Encoded("Version:") %> <%=Html.Encode(theme.Version) %><br />
<%=Html.Encode(theme.Description) %><br /> <%=Html.Encode(theme.Description) %><br />
<%=Html.Encode(theme.HomePage) %> <%=Html.Encode(theme.HomePage) %>
</p> </p>
<% using (Html.BeginFormAntiForgeryPost(Url.Action("Uninstall"), FormMethod.Post, new { @class = "inline" })) <% using (Html.BeginFormAntiForgeryPost(Url.Action("Uninstall"), FormMethod.Post, new { @class = "inline link" })) { %>
{ %> <%=Html.Hidden("themeName", theme.ThemeName)%>
<fieldset> <button type="submit" class="uninstall" title="<%=_Encoded("Uninstall") %>"><%=_Encoded("Uninstall")%></button>
<button type="submit" class="linkButton" title="<%=_Encoded("Uninstall") %>" name="themeName" value="<%=theme.ThemeName %>"><%=_Encoded("Uninstall")%></button> <% } %>
</fieldset>
<% } %>
</div> </div>
</li> </li>
<% } <% }

View File

@@ -2,37 +2,68 @@
<%@ Import Namespace="Orchard.Mvc.Html"%> <%@ Import Namespace="Orchard.Mvc.Html"%>
<%@ Import Namespace="Orchard.Themes.ViewModels"%> <%@ Import Namespace="Orchard.Themes.ViewModels"%>
<style type="text/css"> <style type="text/css">
#themepreview, #themepreview fieldset, #themepreview input, #themepreview select body {
{ margin-top:40px;
margin: 0; padding: 0; border:none; font-size: 1em; width:auto; color: #000;
font-family:Frutiger,"Frutiger Linotype",Univers,Calibri,"Gill Sans","Gill Sans MT","Myriad Pro",Myriad,"DejaVu Sans Condensed","Liberation Sans","Nimbus Sans L",Tahoma,Geneva,"Helvetica Neue",Helvetica,Arial,sans-serif;
} }
/*#themepreview { background: #000; font-size:15px; padding:5px; }*/ #themepreview {
#themepreview span { color: #ccc; padding-right:5px; } background:#2D2F25 url('<%=ResolveUrl("../../Styles/Images/toolBarBackground.gif") %>') repeat-x left top;
#themepreview fieldset { margin: 0; padding: 3px; } border-bottom:1px solid #494d4d;
/*#themepreview button { font-size: 13px; padding:0 3px; margin-left:10px; }*/ font-size:15px;
#themepreview button.preview { margin-left:0; } left:0;
height:30px;
margin:0;
position:absolute;
overflow:hidden;
padding:5px 0;
top:0;
width:100%;
}
#themepreview fieldset,
#themepreview span, #themepreview input,
#themepreview select, #themepreview button {
border:none;
color:#000;
font:1em/1em Frutiger,"Frutiger Linotype",Univers,Calibri,"Gill Sans","Gill Sans MT","Myriad Pro",Myriad,"DejaVu Sans Condensed","Liberation Sans","Nimbus Sans L",Tahoma,Geneva,"Helvetica Neue",Helvetica,Arial,sans-serif;
margin:0;
padding:0;
width:auto;
}
#themepreview span { color: #ccc; padding-right:5px; }
#themepreview fieldset { padding:3px 8px; }
html.dyn #themepreview button.preview { display:none; } html.dyn #themepreview button.preview { display:none; }
#themepreview fieldset * { float:left; }
#themepreview fieldset span { line-height:1.6em; }
#themepreview button.cancel { float:right; } #themepreview button.cancel { float:right; }
#themepreview { background: #2D2F25 url('<%=ResolveUrl("../../Styles/Images/toolBarBackground.gif") %>') repeat-x left top; font-size:15px; padding:5px; border-bottom:1px solid #494d4d;}
/* Button styles */ /* Button styles */
#themepreview button { font-size: 13px; padding:2px 4px; margin: 0 0 0 10px; text-align:center; color:#f1f1f1; border:1px solid; border-top-color:#191d1d; border-right-color:#494d4d; border-bottom-color:#494d4d; border-left-color:#202626; background:#2a2626 url('<%=ResolveUrl("../../Styles/Images/toolBarActiveButtonBackground.gif") %>') repeat-x left center; } #themepreview button {
background:#2a2626 url('<%=ResolveUrl("../../Styles/Images/toolBarActiveButtonBackground.gif") %>') repeat-x left center;
/* Hover for buttons */ border:1px solid;
#themepreview button:hover { color:#fdcc64; border:1px #545959 solid; cursor:pointer; background:#2a2626 url('<%=ResolveUrl("../../Styles/Images/toolBarHoverButtonBackground.gif") %>') repeat-x left center; } border-top-color:#191d1d;
border-right-color:#494d4d;
border-bottom-color:#494d4d;
border-left-color:#202626;
color:#f1f1f1;
line-height:1.22em;
margin: 0 0 0 10px;
padding:0 4px 1px;
text-align:center;
}
#themepreview button:hover {
background:#2a2626 url('<%=ResolveUrl("../../Styles/Images/toolBarHoverButtonBackground.gif") %>') repeat-x left center;
border-color:#545959;
color:#fdcc64;
cursor:pointer;
}
</style> </style>
<div id="themepreview"> <div id="themepreview">
<% using(Html.BeginFormAntiForgeryPost(Url.Action("Preview", new{Controller="Admin", Area="Orchard.Themes"}), FormMethod.Post, new { @class = "inline" })) { %> <% using(Html.BeginFormAntiForgeryPost(Url.Action("Preview", new{Controller="Admin", Area="Orchard.Themes"}), FormMethod.Post, new { @class = "inline" })) { %>
<fieldset> <fieldset>
<span><%=T("You are previewing: ")%></span> <span><%=T("You are previewing: ")%></span>
<%=Html.Hidden("ReturnUrl", Context.Request.Url)%>
<%=Html.DropDownList("ThemeName", Model.Themes, new {onChange = "this.form.submit();"})%> <%=Html.DropDownList("ThemeName", Model.Themes, new {onChange = "this.form.submit();"})%>
<button type="submit" class="preview" title="<%=_Encoded("Preview")%>" name="submit.Preview" value="<%=_Encoded("Preview")%>"><%=_Encoded("Preview")%></button> <button type="submit" class="preview" title="<%=_Encoded("Preview")%>" name="submit.Preview" value="<%=_Encoded("Preview")%>"><%=_Encoded("Preview")%></button>
<button type="submit" title="<%=_Encoded("Apply")%>" name="submit.Apply" value="<%=_Encoded("Apply")%>"><%=_Encoded("Apply this theme") %></button> <button type="submit" title="<%=_Encoded("Apply")%>" name="submit.Apply" value="<%=_Encoded("Apply")%>"><%=_Encoded("Apply this theme") %></button>
<button type="submit" class="cancel" title="<%=_Encoded("Cancel")%>" name="submit.Cancel" value="<%=_Encoded("Cancel")%>"><%=_Encoded("Cancel")%></button> <button type="submit" class="cancel" title="<%=_Encoded("Cancel")%>" name="submit.Cancel" value="<%=_Encoded("Cancel")%>"><%=_Encoded("Cancel")%></button>
<%=Html.Hidden("ReturnUrl", Context.Request.Url)%>
</fieldset> </fieldset>
<% } %> <% } %>
</div> </div>

View File

@@ -731,8 +731,11 @@ todo: (heskew) pull out into relevant modules where appropriate
zoom:1; zoom:1;
*display: inline; *display: inline;
} }
.templates fieldset { .templates .inline button {
margin:0 0 .933%; font-size:1.2em;
}
.templates .wasFormInlineLink {
font-size:1.4em;
} }
.templates p { .templates p {
overflow:hidden; overflow:hidden;