Getting The Admin theme put together (instead of all admin pages including AdminHead and AdminFoot)

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044218
This commit is contained in:
skewed
2009-12-17 10:29:33 +00:00
parent d3b3829314
commit c2b870637f
88 changed files with 2061 additions and 1240 deletions

View File

@@ -76,7 +76,8 @@
<Compile Include="Common\ViewModels\BodyEditorViewModel.cs" />
<Compile Include="Common\ViewModels\OwnerEditorViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Themes\SafeModeThemeSelector.cs" />
<Compile Include="Themes\Services\AdminThemeSelector.cs" />
<Compile Include="Themes\Services\SafeModeThemeSelector.cs" />
<Compile Include="Settings\AdminMenu.cs" />
<Compile Include="Settings\Controllers\AdminController.cs" />
<Compile Include="Settings\Models\SiteSettingsHandler.cs" />

View File

@@ -1,12 +1,10 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Orchard.Core.Settings.ViewModels.SettingsIndexViewModel>" %>
<%@ Import Namespace="Orchard.Mvc.Html"%>
<% Html.Include("AdminHead"); %>
<h2>Edit Settings</h2>
<%using (Html.BeginForm()) { %>
<%= Html.ValidationSummary() %>
<%= Html.EditorForModel() %>
<fieldset>
<input class="button" type="submit" value="Save" />
</fieldset>
<% } %>
<% Html.Include("AdminFoot"); %>
<h2>Edit Settings</h2>
<%using (Html.BeginForm()) { %>
<%= Html.ValidationSummary() %>
<%= Html.EditorForModel() %>
<fieldset>
<input class="button" type="submit" value="Save" />
</fieldset>
<% } %>

View File

@@ -0,0 +1,15 @@
using System.Globalization;
using System.Web.Routing;
using Orchard.Themes;
namespace Orchard.Core.Themes.Services {
public class AdminThemeSelector : IThemeSelector {
public ThemeSelectorResult GetTheme(RequestContext context) {
if (!context.HttpContext.Request.Path.StartsWith("/admin", true, CultureInfo.InvariantCulture))
return null;
return new ThemeSelectorResult { Priority = 0, ThemeName = "TheAdmin" };
}
}
}

View File

@@ -1,7 +1,7 @@
using System.Web.Routing;
using Orchard.Themes;
namespace Orchard.Core.Themes {
namespace Orchard.Core.Themes.Services {
public class SafeModeThemeSelector : IThemeSelector {
public ThemeSelectorResult GetTheme(RequestContext context) {
return new ThemeSelectorResult {Priority = -100, ThemeName = "Themes"};

View File

@@ -47,13 +47,13 @@ h1, h2, h3, h4, h5, h6
font-family: Arial, Helvetica, sans-serif;
}
h1
.home h1
{
font-size: 2em;
padding-bottom: 0;
margin-bottom: 0;
}
h2
h1
{
padding: 0 0 10px 0;
}

View File

@@ -1,36 +1,34 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<ThemesIndexViewModel>" %>
<%@ Import Namespace="Orchard.Core.Themes.ViewModels"%>
<%@ Import Namespace="Orchard.Mvc.Html"%>
<%Html.Include("AdminHead");%>
<h2>Manage Themes</h2>
<h3>Current Theme</h3>
<% 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><%
} 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") %>
</p>
<% } %>
<h3>Available Themes</h3>
<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}) %>
</p>
</li>
<% }
} %>
</ul>
<% Html.Include("AdminFoot"); %>
<h2>Manage Themes</h2>
<h3>Current Theme</h3>
<% 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><%
} 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") %>
</p>
<% } %>
<h3>Available Themes</h3>
<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}) %>
</p>
</li>
<% }
} %>
</ul>

View File

@@ -1,13 +1,11 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="Orchard.Mvc.Html"%>
<% Html.Include("AdminHead"); %>
<h2>Install Theme</h2>
<% using (Html.BeginForm("Install", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) {%>
<%= 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" />
</fieldset>
<% } %>
<% Html.Include("AdminFoot"); %>
<h2>Install Theme</h2>
<% using (Html.BeginForm("Install", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" })) {%>
<%= 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" />
</fieldset>
<% } %>