mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-27 04:19:04 +08:00
#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:
@@ -8,7 +8,7 @@
|
|||||||
<Tags>blog</Tags>
|
<Tags>blog</Tags>
|
||||||
<Version>1.0</Version>
|
<Version>1.0</Version>
|
||||||
</Recipe>
|
</Recipe>
|
||||||
|
|
||||||
<Feature enable="Orchard.Blogs,Orchard.Comments,Orchard.Tags,
|
<Feature enable="Orchard.Blogs,Orchard.Comments,Orchard.Tags,
|
||||||
XmlRpc,Orchard.Blogs.RemotePublishing,
|
XmlRpc,Orchard.Blogs.RemotePublishing,
|
||||||
TinyMce,Orchard.Media,Orchard.MediaPicker,Orchard.PublishLater,
|
TinyMce,Orchard.Media,Orchard.MediaPicker,Orchard.PublishLater,
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
Orchard.Scripting,Orchard.Scripting.Lightweight,
|
Orchard.Scripting,Orchard.Scripting.Lightweight,
|
||||||
PackagingServices,Orchard.Packaging,Gallery.Updates,Orchard.Warmup,
|
PackagingServices,Orchard.Packaging,Gallery.Updates,Orchard.Warmup,
|
||||||
TheThemeMachine" />
|
TheThemeMachine" />
|
||||||
|
|
||||||
<Metadata>
|
<Metadata>
|
||||||
<Types>
|
<Types>
|
||||||
<Page ContentTypeSettings.Draftable="True" TypeIndexing.Included="true">
|
<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
|
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
|
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
|
||||||
site setting set baseurl
|
site setting set baseurl
|
||||||
|
theme activate "The Theme Machine"
|
||||||
</Command>
|
</Command>
|
||||||
</Orchard>
|
</Orchard>
|
||||||
|
|||||||
@@ -8,14 +8,14 @@
|
|||||||
<Tags></Tags>
|
<Tags></Tags>
|
||||||
<Version>1.0</Version>
|
<Version>1.0</Version>
|
||||||
</Recipe>
|
</Recipe>
|
||||||
|
|
||||||
<Feature enable="Orchard.Blogs,Orchard.Comments,Orchard.Tags,
|
<Feature enable="Orchard.Blogs,Orchard.Comments,Orchard.Tags,
|
||||||
Orchard.Lists,TinyMce,Orchard.Media,Orchard.MediaPicker,Orchard.PublishLater,
|
Orchard.Lists,TinyMce,Orchard.Media,Orchard.MediaPicker,Orchard.PublishLater,
|
||||||
Orchard.jQuery,Orchard.Widgets,Orchard.Widgets.PageLayerHinting,Orchard.ContentTypes,
|
Orchard.jQuery,Orchard.Widgets,Orchard.Widgets.PageLayerHinting,Orchard.ContentTypes,
|
||||||
Orchard.Scripting,Orchard.Scripting.Lightweight,
|
Orchard.Scripting,Orchard.Scripting.Lightweight,
|
||||||
PackagingServices,Orchard.Packaging,Gallery.Updates,Orchard.Warmup,
|
PackagingServices,Orchard.Packaging,Gallery.Updates,Orchard.Warmup,
|
||||||
TheThemeMachine" />
|
TheThemeMachine" />
|
||||||
|
|
||||||
<Metadata>
|
<Metadata>
|
||||||
<Types>
|
<Types>
|
||||||
<Page ContentTypeSettings.Draftable="True" TypeIndexing.Included="true">
|
<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
|
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
|
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
|
||||||
site setting set baseurl
|
site setting set baseurl
|
||||||
|
theme activate "The Theme Machine"
|
||||||
</Command>
|
</Command>
|
||||||
</Orchard>
|
</Orchard>
|
||||||
|
|||||||
@@ -7,13 +7,15 @@ using Orchard.ContentManagement;
|
|||||||
using Orchard.Core.Settings.Descriptor.Records;
|
using Orchard.Core.Settings.Descriptor.Records;
|
||||||
using Orchard.Core.Settings.Models;
|
using Orchard.Core.Settings.Models;
|
||||||
using Orchard.Data;
|
using Orchard.Data;
|
||||||
|
using Orchard.Data.Migration;
|
||||||
using Orchard.Data.Migration.Interpreters;
|
using Orchard.Data.Migration.Interpreters;
|
||||||
using Orchard.Data.Migration.Schema;
|
using Orchard.Data.Migration.Schema;
|
||||||
using Orchard.Environment;
|
using Orchard.Environment;
|
||||||
using Orchard.Environment.Configuration;
|
using Orchard.Environment.Configuration;
|
||||||
using Orchard.Environment.ShellBuilders;
|
|
||||||
using Orchard.Environment.Descriptor;
|
using Orchard.Environment.Descriptor;
|
||||||
using Orchard.Environment.Descriptor.Models;
|
using Orchard.Environment.Descriptor.Models;
|
||||||
|
using Orchard.Environment.ShellBuilders;
|
||||||
|
using Orchard.Environment.State;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.Localization.Services;
|
using Orchard.Localization.Services;
|
||||||
using Orchard.Recipes.Models;
|
using Orchard.Recipes.Models;
|
||||||
@@ -21,9 +23,6 @@ using Orchard.Recipes.Services;
|
|||||||
using Orchard.Reports.Services;
|
using Orchard.Reports.Services;
|
||||||
using Orchard.Security;
|
using Orchard.Security;
|
||||||
using Orchard.Settings;
|
using Orchard.Settings;
|
||||||
using Orchard.Environment.State;
|
|
||||||
using Orchard.Data.Migration;
|
|
||||||
using Orchard.Themes.Services;
|
|
||||||
using Orchard.Utility.Extensions;
|
using Orchard.Utility.Extensions;
|
||||||
|
|
||||||
namespace Orchard.Setup.Services {
|
namespace Orchard.Setup.Services {
|
||||||
@@ -172,6 +171,7 @@ namespace Orchard.Setup.Services {
|
|||||||
|
|
||||||
private string CreateTenantData(SetupContext context, IWorkContextScope environment) {
|
private string CreateTenantData(SetupContext context, IWorkContextScope environment) {
|
||||||
string executionId = null;
|
string executionId = null;
|
||||||
|
|
||||||
// create superuser
|
// create superuser
|
||||||
var membershipService = environment.Resolve<IMembershipService>();
|
var membershipService = environment.Resolve<IMembershipService>();
|
||||||
var user =
|
var user =
|
||||||
@@ -191,10 +191,6 @@ namespace Orchard.Setup.Services {
|
|||||||
siteSettings.Record.SuperUser = context.AdminUsername;
|
siteSettings.Record.SuperUser = context.AdminUsername;
|
||||||
siteSettings.Record.SiteCulture = "en-US";
|
siteSettings.Record.SiteCulture = "en-US";
|
||||||
|
|
||||||
// set site theme
|
|
||||||
var themeService = environment.Resolve<ISiteThemeService>();
|
|
||||||
themeService.SetSiteTheme("TheThemeMachine");
|
|
||||||
|
|
||||||
// add default culture
|
// add default culture
|
||||||
var cultureManager = environment.Resolve<ICultureManager>();
|
var cultureManager = environment.Resolve<ICultureManager>();
|
||||||
cultureManager.AddCulture("en-US");
|
cultureManager.AddCulture("en-US");
|
||||||
@@ -202,7 +198,7 @@ namespace Orchard.Setup.Services {
|
|||||||
var recipeManager = environment.Resolve<IRecipeManager>();
|
var recipeManager = environment.Resolve<IRecipeManager>();
|
||||||
executionId = recipeManager.Execute(Recipes().Where(r => r.Name.Equals(context.Recipe, StringComparison.OrdinalIgnoreCase)).FirstOrDefault());
|
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) {
|
if (HttpContext.Current != null) {
|
||||||
authenticationService.SignIn(user, true);
|
authenticationService.SignIn(user, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,13 @@ namespace Orchard.Themes.Controllers {
|
|||||||
bool installThemes = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "PackagingServices") != null;
|
bool installThemes = _featureManager.GetEnabledFeatures().FirstOrDefault(f => f.Id == "PackagingServices") != null;
|
||||||
|
|
||||||
var featuresThatNeedUpdate = _dataMigrationManager.GetFeaturesThatNeedUpdate();
|
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()
|
IEnumerable<ThemeEntry> themes = _extensionManager.AvailableExtensions()
|
||||||
.Where(extensionDescriptor => {
|
.Where(extensionDescriptor => {
|
||||||
bool hidden = false;
|
bool hidden = false;
|
||||||
@@ -80,7 +86,8 @@ namespace Orchard.Themes.Controllers {
|
|||||||
|
|
||||||
return !hidden &&
|
return !hidden &&
|
||||||
DefaultExtensionTypes.IsTheme(extensionDescriptor.ExtensionType) &&
|
DefaultExtensionTypes.IsTheme(extensionDescriptor.ExtensionType) &&
|
||||||
!currentTheme.Descriptor.Id.Equals(extensionDescriptor.Id);
|
(currentTheme == null ||
|
||||||
|
!currentTheme.Descriptor.Id.Equals(extensionDescriptor.Id));
|
||||||
})
|
})
|
||||||
.Select(extensionDescriptor => {
|
.Select(extensionDescriptor => {
|
||||||
ThemeEntry themeEntry = new ThemeEntry(extensionDescriptor) {
|
ThemeEntry themeEntry = new ThemeEntry(extensionDescriptor) {
|
||||||
|
|||||||
@@ -3,13 +3,37 @@
|
|||||||
Script.Require("ShapesBase");
|
Script.Require("ShapesBase");
|
||||||
Style.Include("site.css");
|
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"));
|
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="header">
|
||||||
<div id="branding">
|
<div id="branding">
|
||||||
<h1>@T("Welcome to Orchard")</h1>
|
<h1>@T("Welcome to Orchard")</h1>
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<div id="main">
|
||||||
@Display(Model.Content)
|
@if (Model.Content != null) {
|
||||||
</div>
|
@Display(Model.Content)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@if (Model.Footer != null) {
|
||||||
|
<div id="footer" role="contentinfo">
|
||||||
|
@Display(Model.Footer)
|
||||||
|
</div>
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user