#17925: Setup service was still setting the current theme to be the theme machine. Not doing that. Recipes explicitly set the current theme. Fixing small issue on themes page if no theme is set. Extending safe theme to include minimum zones to make the core recipe homepage look "decent" / usable.

--HG--
branch : 1.x
This commit is contained in:
Andre Rodrigues
2011-06-09 15:36:03 -07:00
parent 6e25797b28
commit 4521f0d1c4
5 changed files with 47 additions and 18 deletions

View File

@@ -8,7 +8,7 @@
<Tags>blog</Tags>
<Version>1.0</Version>
</Recipe>
<Feature enable="Orchard.Blogs,Orchard.Comments,Orchard.Tags,
XmlRpc,Orchard.Blogs.RemotePublishing,
TinyMce,Orchard.Media,Orchard.MediaPicker,Orchard.PublishLater,
@@ -16,7 +16,7 @@
Orchard.Scripting,Orchard.Scripting.Lightweight,
PackagingServices,Orchard.Packaging,Gallery.Updates,Orchard.Warmup,
TheThemeMachine" />
<Metadata>
<Types>
<Page ContentTypeSettings.Draftable="True" TypeIndexing.Included="true">
@@ -53,5 +53,6 @@
widget create HtmlWidget /Title:"Third Leader Aside" /Zone:"TripelThird" /Position:"5" /Layer:"TheHomepage" /Identity:"SetupHtmlWidget3" /UseLoremIpsumText:true
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
site setting set baseurl
theme activate "The Theme Machine"
</Command>
</Orchard>

View File

@@ -8,14 +8,14 @@
<Tags></Tags>
<Version>1.0</Version>
</Recipe>
<Feature enable="Orchard.Blogs,Orchard.Comments,Orchard.Tags,
Orchard.Lists,TinyMce,Orchard.Media,Orchard.MediaPicker,Orchard.PublishLater,
Orchard.jQuery,Orchard.Widgets,Orchard.Widgets.PageLayerHinting,Orchard.ContentTypes,
Orchard.Scripting,Orchard.Scripting.Lightweight,
PackagingServices,Orchard.Packaging,Gallery.Updates,Orchard.Warmup,
TheThemeMachine" />
<Metadata>
<Types>
<Page ContentTypeSettings.Draftable="True" TypeIndexing.Included="true">
@@ -49,5 +49,6 @@
widget create HtmlWidget /Title:"Third Leader Aside" /Zone:"TripelThird" /Position:"5" /Layer:"TheHomepage" /Identity:"SetupHtmlWidget3" /UseLoremIpsumText:true
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
site setting set baseurl
theme activate "The Theme Machine"
</Command>
</Orchard>

View File

@@ -7,13 +7,15 @@ using Orchard.ContentManagement;
using Orchard.Core.Settings.Descriptor.Records;
using Orchard.Core.Settings.Models;
using Orchard.Data;
using Orchard.Data.Migration;
using Orchard.Data.Migration.Interpreters;
using Orchard.Data.Migration.Schema;
using Orchard.Environment;
using Orchard.Environment.Configuration;
using Orchard.Environment.ShellBuilders;
using Orchard.Environment.Descriptor;
using Orchard.Environment.Descriptor.Models;
using Orchard.Environment.ShellBuilders;
using Orchard.Environment.State;
using Orchard.Localization;
using Orchard.Localization.Services;
using Orchard.Recipes.Models;
@@ -21,9 +23,6 @@ using Orchard.Recipes.Services;
using Orchard.Reports.Services;
using Orchard.Security;
using Orchard.Settings;
using Orchard.Environment.State;
using Orchard.Data.Migration;
using Orchard.Themes.Services;
using Orchard.Utility.Extensions;
namespace Orchard.Setup.Services {
@@ -172,6 +171,7 @@ namespace Orchard.Setup.Services {
private string CreateTenantData(SetupContext context, IWorkContextScope environment) {
string executionId = null;
// create superuser
var membershipService = environment.Resolve<IMembershipService>();
var user =
@@ -191,10 +191,6 @@ namespace Orchard.Setup.Services {
siteSettings.Record.SuperUser = context.AdminUsername;
siteSettings.Record.SiteCulture = "en-US";
// set site theme
var themeService = environment.Resolve<ISiteThemeService>();
themeService.SetSiteTheme("TheThemeMachine");
// add default culture
var cultureManager = environment.Resolve<ICultureManager>();
cultureManager.AddCulture("en-US");
@@ -202,7 +198,7 @@ namespace Orchard.Setup.Services {
var recipeManager = environment.Resolve<IRecipeManager>();
executionId = recipeManager.Execute(Recipes().Where(r => r.Name.Equals(context.Recipe, StringComparison.OrdinalIgnoreCase)).FirstOrDefault());
//null check: temporary fix for running setup in command line
// null check: temporary fix for running setup in command line
if (HttpContext.Current != null) {
authenticationService.SignIn(user, true);
}

View File

@@ -69,7 +69,13 @@ namespace Orchard.Themes.Controllers {
bool installThemes = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "PackagingServices") != null;
var featuresThatNeedUpdate = _dataMigrationManager.GetFeaturesThatNeedUpdate();
ThemeEntry currentTheme = new ThemeEntry(_siteThemeService.GetSiteTheme());
ThemeEntry currentTheme = null;
ExtensionDescriptor currentThemeDescriptor = _siteThemeService.GetSiteTheme();
if (currentThemeDescriptor != null) {
currentTheme = new ThemeEntry(currentThemeDescriptor);
}
IEnumerable<ThemeEntry> themes = _extensionManager.AvailableExtensions()
.Where(extensionDescriptor => {
bool hidden = false;
@@ -80,7 +86,8 @@ namespace Orchard.Themes.Controllers {
return !hidden &&
DefaultExtensionTypes.IsTheme(extensionDescriptor.ExtensionType) &&
!currentTheme.Descriptor.Id.Equals(extensionDescriptor.Id);
(currentTheme == null ||
!currentTheme.Descriptor.Id.Equals(extensionDescriptor.Id));
})
.Select(extensionDescriptor => {
ThemeEntry themeEntry = new ThemeEntry(extensionDescriptor) {

View File

@@ -3,13 +3,37 @@
Script.Require("ShapesBase");
Style.Include("site.css");
RegisterLink(new LinkEntry { Condition = "lte IE 6", Rel = "stylesheet", Type="text/css", Href = Href("../Styles/ie6.css")}.AddAttribute("media", "screen, projection"));
if (!string.IsNullOrEmpty(WorkContext.CurrentSite.SuperUser)) {
WorkContext.Layout.Footer.Add(New.User(), "10"); // Login and dashboard links
}
}
<div id="header">
<div id="branding">
<h1>@T("Welcome to Orchard")</h1>
</div>
</div>
@Display(Model.Messages)
@if (Model.Navigation != null) {
<div id="layout-navigation" class="group">
@Display(Model.Navigation)
</div>
}
@if (Model.Messages != null) {
<div id="messages">
@Display(Model.Messages)
</div>
}
<div id="main">
@Display(Model.Content)
</div>
@if (Model.Content != null) {
@Display(Model.Content)
}
</div>
@if (Model.Footer != null) {
<div id="footer" role="contentinfo">
@Display(Model.Footer)
</div>
}