A few more tweaks to the theme preview (resurrecting the cancel button and changing redirect on apply url)

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4046097
This commit is contained in:
skewed
2010-01-29 21:09:14 +00:00
parent bc46cb3692
commit 034607ef4e
2 changed files with 3 additions and 4 deletions

View File

@@ -62,7 +62,7 @@ namespace Orchard.Core.Themes.Controllers {
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_previewTheme.SetPreviewTheme(null); _previewTheme.SetPreviewTheme(null);
_themeService.SetSiteTheme(themeName); _themeService.SetSiteTheme(themeName);
return Redirect(returnUrl ?? "~/"); return RedirectToAction("Index");
} }
catch (Exception exception) { catch (Exception exception) {
_notifier.Error(T("Previewing theme failed: " + exception.Message)); _notifier.Error(T("Previewing theme failed: " + exception.Message));

View File

@@ -12,7 +12,7 @@
#themepreview button { font-size: 13px; padding:0 3px; margin-left:10px; } #themepreview button { font-size: 13px; padding:0 3px; margin-left:10px; }
#themepreview button.preview { margin-left:0; } #themepreview button.preview { margin-left:0; }
html.dyn #themepreview button.preview { display:none; } html.dyn #themepreview button.preview { display:none; }
#themepreview a { color:#ccc; float:right; line-height:21px; } #themepreview button.cancel { float:right; }
</style> </style>
<div id="themepreview"> <div id="themepreview">
<% using(Html.BeginFormAntiForgeryPost(Url.Action("Preview", new{Controller="Admin", Area="Themes"}), FormMethod.Post, new { @class = "inline" })) { %> <% using(Html.BeginFormAntiForgeryPost(Url.Action("Preview", new{Controller="Admin", Area="Themes"}), FormMethod.Post, new { @class = "inline" })) { %>
@@ -21,8 +21,7 @@ html.dyn #themepreview button.preview { display:none; }
<%=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>
<%=Html.ActionLink(T("Back to Admin").ToString(), "Index", new { Controller = "Admin", Area = "Themes" })%> <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)%> <%=Html.Hidden("ReturnUrl", Context.Request.Url)%>
</fieldset> </fieldset>
<% } %> <% } %>