--HG--
branch : 1.x
This commit is contained in:
Andre Rodrigues
2011-03-30 17:32:58 -07:00
37 changed files with 231 additions and 256 deletions

View File

@@ -24,3 +24,5 @@ glob:*.build.csdef
glob:src/Orchard.Azure/Orchard.Azure.Web/Core
glob:src/Orchard.Azure/Orchard.Azure.Web/Modules
glob:src/Orchard.Azure/Orchard.Azure.Web/Themes
syntax: glob
src/Orchard.Web/Orchard.Web.Publish.xml

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="AzureSDK" value="C:\Program Files\Windows Azure SDK\v1.3\"/>
<add key="AzureSDK" value="C:\Program Files\Windows Azure SDK\v1.4\"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>

View File

@@ -1,5 +1,4 @@
using System.ComponentModel;
using System.Configuration;
using System.Configuration;
using System.Diagnostics;
using System.IO;
using Microsoft.WindowsAzure;

View File

@@ -10,19 +10,19 @@ namespace Orchard.Azure.Tests.FileSystems.Media {
[TestFixture]
public class AzureBlobStorageProviderTests : AzureVirtualEnvironmentTest {
CloudStorageAccount DevAccount;
CloudStorageAccount _devAccount;
private AzureBlobStorageProvider _azureBlobStorageProvider;
protected override void OnInit() {
CloudStorageAccount.TryParse("UseDevelopmentStorage=true", out DevAccount);
CloudStorageAccount.TryParse("UseDevelopmentStorage=true", out _devAccount);
_azureBlobStorageProvider = new AzureBlobStorageProvider(new ShellSettings { Name = "default" }, DevAccount);
_azureBlobStorageProvider = new AzureBlobStorageProvider(new ShellSettings { Name = "default" }, _devAccount);
}
[SetUp]
public void Setup() {
// ensure default container is empty before running any test
DeleteAllBlobs(_azureBlobStorageProvider.Container.Name, DevAccount);
DeleteAllBlobs(_azureBlobStorageProvider.Container.Name, _devAccount);
}
[Test]
@@ -128,6 +128,23 @@ namespace Orchard.Azure.Tests.FileSystems.Media {
Assert.AreEqual("folder", _azureBlobStorageProvider.ListFolders("folder").First().GetName());
}
[Test]
public void ShouldDeleteFiles() {
_azureBlobStorageProvider.CreateFile("folder/foo1.txt");
_azureBlobStorageProvider.CreateFile("folder/foo2.txt");
_azureBlobStorageProvider.CreateFile("folder/folder/foo1.txt");
_azureBlobStorageProvider.CreateFile("folder/folder/foo2.txt");
Assert.That(_azureBlobStorageProvider.ListFiles("folder").Count(), Is.EqualTo(2));
Assert.That(_azureBlobStorageProvider.ListFiles("folder/folder").Count(), Is.EqualTo(2));
_azureBlobStorageProvider.DeleteFile("folder/foo1.txt");
_azureBlobStorageProvider.DeleteFile("folder/folder/foo2.txt");
Assert.That(_azureBlobStorageProvider.ListFiles("folder").Count(), Is.EqualTo(1));
Assert.That(_azureBlobStorageProvider.ListFiles("folder/folder").Count(), Is.EqualTo(1));
}
[Test]
public void DeleteFolderShouldDeleteFilesAlso() {
_azureBlobStorageProvider.CreateFile("folder/foo1.txt");
@@ -167,17 +184,15 @@ namespace Orchard.Azure.Tests.FileSystems.Media {
[Test]
[ExpectedException(typeof(ArgumentException))]
public void CannotCreateAlreadyExistingFolders()
{
public void CannotCreateAlreadyExistingFolders() {
_azureBlobStorageProvider.CreateFile("folder1/foo.txt");
_azureBlobStorageProvider.CreateFolder("folder1");
}
[Test]
public void CanCreateAlreadyExistingFolder()
{
public void CanCreateAlreadyExistingFolder() {
_azureBlobStorageProvider.CreateFile("folder1/foo.txt");
_azureBlobStorageProvider.TryCreateFolder("folder1");
Assert.That(_azureBlobStorageProvider.TryCreateFolder("folder1"), Is.True);
}
[Test]

View File

@@ -155,15 +155,15 @@ namespace Orchard.Azure {
}
public bool TryCreateFolder(string path) {
EnsurePathIsRelative(path);
using (new HttpContextWeaver()) {
if (Container.DirectoryExists(String.Concat(_root, path))) {
return true;
try {
if (!Container.DirectoryExists(String.Concat(_root, path))) {
CreateFolder(path);
}
CreateFile(Combine(path, FolderEntry));
return true;
}
catch {
return false;
}
return true;
}
public void CreateFolder(string path) {

View File

@@ -8,8 +8,8 @@
<ProjectGuid>{5C0D5249-AEF5-4BB6-8F5F-057B91AC2D7A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Orchard.Startup</RootNamespace>
<AssemblyName>Orchard.Startup</AssemblyName>
<RootNamespace>Orchard.WarmupStarter</RootNamespace>
<AssemblyName>Orchard.WarmupStarter</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>

View File

@@ -4,7 +4,7 @@ using System.Web;
using Autofac;
using Orchard.Environment;
namespace Orchard.Startup {
namespace Orchard.WarmupStarter {
public class Starter {
private static IOrchardHost _host;
private static Exception _error;

View File

@@ -6,7 +6,7 @@ using System.Threading;
using System.Web;
using System.Web.Hosting;
namespace Orchard.Startup {
namespace Orchard.WarmupStarter {
public class WarmupHttpModule : IHttpModule {
private const string WarmupFilesPath = "~/App_Data/Warmup/";
private HttpApplication _context;

View File

@@ -54,7 +54,7 @@
<staticLogFileName value="false" />
<rollingStyle value="Date" />
<rollingStyleFrequency value="Once" />
<datepattern value="-dd.MM.yyyy'.log'" />
<datepattern value="-yyyy.MM.dd'.log'" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %logger - %message%newline" />
@@ -73,7 +73,7 @@
<staticLogFileName value="false" />
<rollingStyle value="Date" />
<rollingStyleFrequency value="Once" />
<datepattern value="-dd.MM.yyyy'.log'" />
<datepattern value="-yyyy.MM.dd'.log'" />
<filter type="log4net.Filter.LevelRangeFilter">
<!-- only error and fatal messages end up in this target, even if child loggers accept lower priority -->

View File

@@ -2,7 +2,7 @@
using System.Web.Mvc;
using System.Web.Routing;
using Autofac;
using Orchard.Startup;
using Orchard.WarmupStarter;
namespace Orchard.Web {
// Note: For instructions on enabling IIS6 or IIS7 classic mode,

View File

@@ -280,10 +280,7 @@
$('li[tree-shape-id="' + shapeNode.id + '"]').parents('li').andSelf().find('> .expando-glyph-container').each(function () {
openExpando($(this));
})
.last()
.each(function () {
this.scrollIntoView()
});
.get(0).scrollIntoView();
refreshBreadcrumb();

View File

@@ -1,47 +0,0 @@
using Orchard.Environment;
using Orchard.Environment.Extensions.Models;
using Orchard.Tasks.Indexing;
using Orchard.ContentManagement;
namespace Orchard.Indexing {
public class DefaultIndexingUpdater : IFeatureEventHandler {
private readonly IIndexingTaskManager _indexingTaskManager;
private readonly IContentManager _contentManager;
public DefaultIndexingUpdater (IIndexingTaskManager indexingTaskManager, IContentManager contentManager){
_indexingTaskManager = indexingTaskManager;
_contentManager = contentManager;
}
public void Installing(Feature feature) {
}
public void Installed(Feature feature) {
}
public void Enabling(Feature feature) {
}
public void Enabled(Feature feature) {
// create indexing tasks for all currently existing content, even when the module is enabled again
// as some content might have been created while this module was not active, and indexing tasks
// would not exist for them, resulting in an uncomplete index.
foreach (var contentItem in _contentManager.Query(VersionOptions.Published).List()) {
_indexingTaskManager.CreateUpdateIndexTask(contentItem);
}
}
public void Disabling(Feature feature) {
}
public void Disabled(Feature feature) {
}
public void Uninstalling(Feature feature) {
}
public void Uninstalled(Feature feature) {
}
}
}

View File

@@ -52,7 +52,6 @@
<Compile Include="Commands\IndexingCommands.cs" />
<Compile Include="Controllers\AdminController.cs" />
<Compile Include="Migrations.cs" />
<Compile Include="DefaultIndexingUpdater.cs" />
<Compile Include="Handlers\CreateIndexingTaskHandler.cs" />
<Compile Include="Handlers\InfosetFieldIndexingHandler.cs" />
<Compile Include="Models\IndexingTask.cs" />

View File

@@ -198,7 +198,7 @@ namespace Orchard.Media.Controllers {
Services.Notifier.Information(T("Media file(s) uploaded"));
return RedirectToAction("Edit", new { name = viewModel.FolderName, mediaPath = viewModel.MediaPath });
} catch (Exception exception) {
this.Error(exception, T("Uploading media file failed: {0}", exception.Message), Logger, Services.Notifier);
this.Error(exception, T("Uploading media file failed:"), Logger, Services.Notifier);
return View(viewModel);
}

View File

@@ -196,14 +196,17 @@ namespace Orchard.Media.Services {
return _storageProvider.GetPublicUrl(folderPath);
}
if (FileAllowed(fileName, true)) {
string filePath = _storageProvider.Combine(folderPath, fileName);
_storageProvider.SaveStream(filePath, inputStream);
if (!FileAllowed(fileName, true)) {
var currentSite = _orchardServices.WorkContext.CurrentSite;
var mediaSettings = currentSite.As<MediaSettingsPart>();
return _storageProvider.GetPublicUrl(filePath);
throw new ArgumentException(T("Could not upload file {0}. Supported file types are {1}.", fileName, mediaSettings.UploadAllowedFileTypeWhitelist).Text);
}
return null;
string filePath = _storageProvider.Combine(folderPath, fileName);
_storageProvider.SaveStream(filePath, inputStream);
return _storageProvider.GetPublicUrl(filePath);
}
/// <summary>

View File

@@ -41,11 +41,7 @@ body {
overflow-y:scroll;
overflow-x:hidden;
}
/*input[disabled], input[disabled="disabled"], input.disabled {
color: #fff;
}*/
.media-largepreview
{
width: 300px;

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using Orchard.Commands;
using Orchard.Setup.Services;
@@ -32,11 +33,15 @@ namespace Orchard.Setup.Commands {
[OrchardSwitch]
public string EnabledFeatures { get; set; }
[OrchardSwitch]
public string Recipe { get; set; }
[CommandHelp("setup /SiteName:<siteName> /AdminUsername:<username> /AdminPassword:<password> /DatabaseProvider:<SqlCe|SQLServer> " +
"/DatabaseConnectionString:<connection_string> /DatabaseTablePrefix:<table_prefix> /EnabledFeatures:<feature1,feature2,...>" +
"/DatabaseConnectionString:<connection_string> /DatabaseTablePrefix:<table_prefix> /EnabledFeatures:<feature1,feature2,...> " +
"/Recipe:<recipe>" +
"\r\n\tRun first time setup for the site or for a given tenant")]
[CommandName("setup")]
[OrchardSwitches("SiteName,AdminUsername,AdminPassword,DatabaseProvider,DatabaseConnectionString,DatabaseTablePrefix,EnabledFeatures")]
[OrchardSwitches("SiteName,AdminUsername,AdminPassword,DatabaseProvider,DatabaseConnectionString,DatabaseTablePrefix,EnabledFeatures,Recipe")]
public void Setup() {
IEnumerable<string> enabledFeatures = null;
if (!string.IsNullOrEmpty(this.EnabledFeatures)) {
@@ -45,23 +50,26 @@ namespace Orchard.Setup.Commands {
.Select(s => s.Trim())
.Where(s => !string.IsNullOrEmpty(s));
}
Recipe = String.IsNullOrEmpty(Recipe) ? "Default" : Recipe;
var setupContext = new SetupContext {
SiteName = this.SiteName,
AdminUsername = this.AdminUsername,
AdminPassword = this.AdminPassword,
DatabaseProvider = this.DatabaseProvider,
DatabaseConnectionString = this.DatabaseConnectionString,
DatabaseTablePrefix = this.DatabaseTablePrefix,
EnabledFeatures = enabledFeatures
SiteName = SiteName,
AdminUsername = AdminUsername,
AdminPassword = AdminPassword,
DatabaseProvider = DatabaseProvider,
DatabaseConnectionString = DatabaseConnectionString,
DatabaseTablePrefix = DatabaseTablePrefix,
EnabledFeatures = enabledFeatures,
Recipe = Recipe,
};
_setupService.Setup(setupContext);
Context.Output.WriteLine(T("Site \"{0}\" sucessfully setup to run data provider \"{1}\" (with table prefix \"{2}\").",
Context.Output.WriteLine(T("Site \"{0}\" successfully setup to run data provider \"{1}\" (with table prefix \"{2}\") and configured by recipe \"{3}\"",
setupContext.SiteName,
setupContext.DatabaseProvider,
setupContext.DatabaseTablePrefix));
setupContext.DatabaseTablePrefix,
setupContext.Recipe));
}
}
}

View File

@@ -1,13 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using Orchard.ContentManagement;
using Orchard.Core.Contents.Controllers;
using Orchard.Environment.Warmup;
using Orchard.FileSystems.AppData;
using Orchard.Localization;
using Orchard.Security;
@@ -16,16 +11,15 @@ using Orchard.UI.Notify;
using Orchard.Warmup.Services;
namespace Orchard.Warmup.Controllers {
[ValidateInput(false)]
public class AdminController : Controller, IUpdateModel {
private readonly IWarmupScheduler _warmupScheduler;
private readonly IAppDataFolder _appDataFolder;
public AdminController(
IOrchardServices services,
IWarmupScheduler warmupScheduler,
IAppDataFolder appDataFolder) {
_warmupScheduler = warmupScheduler;
_appDataFolder = appDataFolder;
Services = services;
T = NullLocalizer.Instance;
@@ -51,7 +45,14 @@ namespace Orchard.Warmup.Controllers {
var warmupPart = Services.WorkContext.CurrentSite.As<WarmupSettingsPart>();
if(TryUpdateModel(warmupPart)) {
Services.Notifier.Information(T("Warmup updated successfully."));
using (var urlReader = new StringReader(warmupPart.Urls)) {
string relativeUrl;
while (null != (relativeUrl = urlReader.ReadLine())) {
if(!Uri.IsWellFormedUriString(relativeUrl, UriKind.Relative) || !(relativeUrl.StartsWith("/"))) {
AddModelError("Urls", T("{0} is an invalid warmup url.", relativeUrl));
}
}
}
}
if (warmupPart.Scheduled) {
@@ -60,6 +61,7 @@ namespace Orchard.Warmup.Controllers {
}
}
Services.Notifier.Information(T("Warmup updated successfully."));
return View(warmupPart);
}
@@ -76,83 +78,6 @@ namespace Orchard.Warmup.Controllers {
return result;
}
[FormValueRequired("submit.Extract")]
[HttpPost, ActionName("Index")]
public ActionResult IndexPostExtract() {
var baseUrl = Services.WorkContext.CurrentSite.BaseUrl;
baseUrl = VirtualPathUtility.AppendTrailingSlash(baseUrl);
var part = Services.WorkContext.CurrentSite.As<WarmupSettingsPart>();
if (String.IsNullOrWhiteSpace(baseUrl) || String.IsNullOrWhiteSpace(part.Urls)) {
return RedirectToAction("Index");
}
var regex = new Regex(@"<link\s[^>]*href=""(?<url>[^""]*\.css)""|<script\s[^>]*src=""(?<url>[^""]*\.js)""", RegexOptions.IgnoreCase);
var resources = new List<string>();
// add the already registered urls to remove duplicates
using (var urlReader = new StringReader(part.Urls)) {
string relativeUrl;
while (null != (relativeUrl = urlReader.ReadLine())) {
if (String.IsNullOrWhiteSpace(relativeUrl)) {
continue;
}
relativeUrl = relativeUrl.Trim();
resources.Add(relativeUrl);
try {
var contentUrl = VirtualPathUtility.RemoveTrailingSlash(baseUrl) + relativeUrl;
var filename = WarmupUtility.EncodeUrl(contentUrl.TrimEnd('/'));
var path = _appDataFolder.Combine("Warmup", filename);
if(!_appDataFolder.FileExists(path)) {
continue;
}
var content = _appDataFolder.ReadFile(path);
// process only html files
if (!content.Contains("<html") && !content.Contains("</html")) {
continue;
}
var localPrefix = Request.ApplicationPath ?? "/";
var matches = regex.Matches(content);
foreach (Match m in matches) {
var url = m.Groups["url"].Value;
if (url.StartsWith(localPrefix, StringComparison.OrdinalIgnoreCase)) {
resources.Add(url.Substring(localPrefix.Length));
}
else if (url.StartsWith(baseUrl, StringComparison.OrdinalIgnoreCase)) {
resources.Add("/" + url.Substring(baseUrl.Length));
}
else if (!url.StartsWith("http://") && !url.StartsWith("/")) {
// relative urls e.g., ../, foo.js, ...
relativeUrl = VirtualPathUtility.AppendTrailingSlash(relativeUrl);
url = VirtualPathUtility.Combine(relativeUrl, url);
resources.Add(url);
}
}
}
catch {
// if something unexpected happens, process next file
continue;
}
}
}
// extract unique urls
var uniqueResources = resources.GroupBy(x => x.ToLowerInvariant()).Select(x => x.First()).ToArray();
part.Urls = String.Join(System.Environment.NewLine, uniqueResources);
return RedirectToAction("Index");
}
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
return TryUpdateModel(model, prefix, includeProperties, excludeProperties);
}

View File

@@ -33,6 +33,5 @@
<fieldset>
<button class="primaryAction" name="submit" value="@T("Save")" type="submit">@T("Save")</button>
<button class="primaryAction" name="submit.Generate" value="@T("Save and generate")" type="submit">@T("Save and generate")</button>
<button class="primaryAction" name="submit.Extract" value="@T("Extract resources")" type="submit">@T("Extract resources")</button>
</fieldset>
}

View File

@@ -80,6 +80,7 @@ namespace Orchard.Widgets.Controllers {
.Widgets(_widgetsService.GetWidgets())
.Zones(currentThemesZones)
.OrphanZones(allZones.Except(currentThemesZones))
.OrphanWidgets(_widgetsService.GetOrphanedWidgets())
.ZonePreviewImage(zonePreviewImage);
// Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
@@ -236,7 +237,7 @@ namespace Orchard.Widgets.Controllers {
}
Services.Notifier.Information(T("Your {0} has been created.", layerPart.TypeDefinition.DisplayName));
return RedirectToAction("Index", "Admin", new { id = layerPart.Id });
return RedirectToAction("Index", "Admin", new { layerId = layerPart.Id });
} catch (Exception exception) {
this.Error(exception, T("Creating layer failed: {0}", exception.Message), Logger, Services.Notifier);
return RedirectToAction("Index");

View File

@@ -15,11 +15,13 @@ namespace Orchard.Widgets.Filters {
private readonly IContentManager _contentManager;
private readonly IWorkContextAccessor _workContextAccessor;
private readonly IRuleManager _ruleManager;
private readonly IWidgetsService _widgetsService;
public WidgetFilter(IContentManager contentManager, IWorkContextAccessor workContextAccessor, IRuleManager ruleManager) {
public WidgetFilter(IContentManager contentManager, IWorkContextAccessor workContextAccessor, IRuleManager ruleManager, IWidgetsService widgetsService) {
_contentManager = contentManager;
_workContextAccessor = workContextAccessor;
_ruleManager = ruleManager;
_widgetsService = widgetsService;
Logger = NullLogger.Instance;
T = NullLocalizer.Instance;
}
@@ -44,7 +46,7 @@ namespace Orchard.Widgets.Filters {
// Once the Rule Engine is done:
// Get Layers and filter by zone and rule
IEnumerable<WidgetPart> widgetParts = _contentManager.Query<WidgetPart, WidgetPartRecord>().List();
IEnumerable<WidgetPart> widgetParts = _widgetsService.GetWidgets();
IEnumerable<LayerPart> activeLayers = _contentManager.Query<LayerPart, LayerPartRecord>().List();
var activeLayerIds = new List<int>();

View File

@@ -121,7 +121,6 @@
<Content Include="Views\Widget.Edit.cshtml" />
<Content Include="Views\Widget.cshtml" />
<Content Include="Views\Widget.ControlWrapper.cshtml" />
<Content Include="Views\Content-WidgetPage.cshtml" />
<Content Include="Views\Widget.Wrapper.cshtml" />
</ItemGroup>
<ItemGroup>
@@ -162,6 +161,9 @@
<ItemGroup>
<Content Include="Views\WidgetPlacement.Zones.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\WidgetPlacement.Orphans.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -14,6 +14,7 @@ namespace Orchard.Widgets.Services {
IEnumerable<Tuple<string, string>> GetWidgetTypes();
IEnumerable<string> GetWidgetTypeNames();
IEnumerable<WidgetPart> GetWidgets();
IEnumerable<WidgetPart> GetOrphanedWidgets();
IEnumerable<WidgetPart> GetWidgets(int layerId);
WidgetPart GetWidget(int widgetId);

View File

@@ -46,12 +46,25 @@ namespace Orchard.Widgets.Services {
.List();
}
public IEnumerable<WidgetPart> GetWidgets() {
private IEnumerable<WidgetPart> GetAllWidgets() {
return _contentManager
.Query<WidgetPart, WidgetPartRecord>()
.List();
}
public IEnumerable<WidgetPart> GetWidgets() {
return GetAllWidgets().Where(w => w.Has<ICommonPart>());
}
// info: (heskew) Just including invalid widgets for now. Eventually need to include any in a layer which no longer exists if possible.
public IEnumerable<WidgetPart> GetOrphanedWidgets() {
return GetAllWidgets().Where(w => !w.Has<ICommonPart>());
}
public IEnumerable<WidgetPart> GetWidgets(int layerId) {
return GetWidgets().Where(widgetPart => widgetPart.As<ICommonPart>().Container.ContentItem.Id == layerId);
}
public IEnumerable<string> GetZones() {
return _featureManager.GetEnabledFeatures()
.Select(x => x.Extension)
@@ -86,10 +99,6 @@ namespace Orchard.Widgets.Services {
return zones;
}
public IEnumerable<WidgetPart> GetWidgets(int layerId) {
return GetWidgets().Where(widgetPart => widgetPart.As<ICommonPart>().Container.ContentItem.Id == layerId);
}
public LayerPart GetLayer(int layerId) {
return GetLayers().FirstOrDefault(layer => layer.Id == layerId);
}

View File

@@ -37,15 +37,19 @@ vertical-align:middle;
margin-left:10px;
}
#widgets-zones, #widgets-available {
#widgets-zones, #widgets-zones-orphans, #widgets-available {
background:#F3F4F5;
border:1px solid #E4E5E6;
padding:5px;
}
#widgets-zones-orphans {
#widgets-orphans {
margin:20px 10px 10px;
padding:5px;
}
#widgets-zones-orphans-container {
margin-top:40px;
}
#widgets-zones-orphans p {
#widgets-zones-orphans-container p {
margin-bottom:10px;
}
/* The number seems slightly meaningless. Leaving it out for now. * /
@@ -53,10 +57,13 @@ margin-bottom:10px;
list-style:decimal inside;
}
*/
#widgets-zones ol {
.widgets-listed ol {
}
#widgets-zones li, #widgets-available li {
#widgets-orphans ul {
margin-top:10px;
}
.widgets-listed li, #widgets-available li {
background:#FFF;
color:#AEC3CE;
border:1px solid #EAEAEA;
@@ -64,22 +71,27 @@ margin:0 0 5px;
padding:0 10px;
position:relative;
}
#widgets-orphans li {
padding:5px 10px;
}
#widgets-available li {
margin:5px 0;
}
#widgets-zones li.last {
.widgets-listed li.last {
margin:0;
}
#widgets-zones li:hover, #widgets-zones li.on {
border-color:#bfd3a7;
.widgets-listed li:hover, .widgets-listed li.on {
/*border-color:#bfd3a7;*/
border-color:#487328;
}
#widgets-available h2 {
font-size:1.231em;
}
#widgets-zones h2, #widgets-zones li li, #widgets-layer-visibility li {
.widgets-listed h2, .widgets-listed li li, #widgets-layer-visibility li {
color:#333;
}
#widgets-zones li li, #widgets-layer-visibility li {
.widgets-listed li li, #widgets-layer-visibility li {
background:#F3F4F5;
border:0;
border-left:3px solid #EAEAEA;
@@ -89,32 +101,45 @@ padding:5px 100px 5px 25px;
#widgets-layer-visibility li {
margin:1px 0 0;
}
#widgets-zones li li.widgets-this-layer, #widgets-layer-visibility li.widgets-this-layer, #widgets-layer-visibility li.widgets-this-layer:hover {
border-color:#898989;
.widgets-listed li li.widgets-this-layer, #widgets-layer-visibility li.widgets-this-layer {
border-color:#cfe493;
border-color:#487328;
background-color:#e6f1c9;
}
#widgets-zones li li.widgets-this-layer:hover, #widgets-layer-visibility li:hover {
border-color:#bfd3a7;
/*#widgets-layer-visibility li.widgets-this-layer:hover {
border-color:#487328;
}*/
.widgets-listed li li.widgets-this-layer:hover, #widgets-layer-visibility li:hover {
/*border-color:#bfd3a7;*/
border-color:#487328;
}
#widgets-zones .widgets-mover {
#widgets-layer-visibility li.widgets-empty-layer:hover, #widgets-layer-visibility li.off:hover {
border-color:#eaeaea;
}
#widgets-layer-visibility li.widgets-this-layer.widgets-empty-layer:hover {
border-color:#cfe493;
border-color:#487328;
}
.widgets-listed .widgets-mover {
margin-left:-18px;
vertical-align:-2px;
}
#widgets-zones .widgets-actions {
.widgets-listed .widgets-actions {
position:absolute;
right:10px;
top:5px;
}
#widgets-zones .widgets-zone-widgets li {
.widgets-listed .widgets-zone-widgets li {
position:relative;
}
#widgets-zones .widgets-zone-widgets .widgets-move-somewhere {
.widgets-listed .widgets-zone-widgets .widgets-move-somewhere {
left:3px;
overflow:hidden;
position:absolute;
top:1px;
width:20px;
}
#widgets-zones .widgets-move {
.widgets-listed .widgets-move {
background:url(images/arrows.png) 7px -31px no-repeat;
border:0;
webkit-border-radius:0;
@@ -130,21 +155,21 @@ padding:0;
text-indent:-9999em;
width:20px;
}
#widgets-zones .widgets-move-down {
.widgets-listed .widgets-move-down {
background-position:7px -58px;
margin-top:1px;
}
#widgets-zones .widgets-move-up:hover {
.widgets-listed .widgets-move-up:hover {
background-position:7px -71px;
}
#widgets-zones .widgets-move-down:hover {
.widgets-listed .widgets-move-down:hover {
background-position:7px -98px;
}
#widgets-zones .widgets-move-up[disabled] {
.widgets-listed .widgets-move-up[disabled] {
background-position:7px 9px;
cursor:default;
}
#widgets-zones .widgets-move-down[disabled] {
.widgets-listed .widgets-move-down[disabled] {
background-position:7px -18px;
cursor:default;
}
@@ -159,11 +184,12 @@ display:block;
padding:5px 10px;
}
#widgets-available li a:hover {
border-color:#bfd3a7;
/*border-color:#bfd3a7;*/
border-color:#487328;
}
#widgets-available a h2, #widgets-available a p {
/*#widgets-available a h2, #widgets-available a p {
color:#333;
}
}*/
#widgets-available a p {
margin-top:5px;
}
@@ -178,12 +204,15 @@ margin-top:0;
#widgets-layer-visibility li {
cursor:default;
}
#widgets-layer-visibility .widgets-other-layer, #widgets-layer-visibility .widgets-this-layer {
#widgets-layer-visibility .widgets-other-layer, #widgets-layer-visibility .widgets-this-layer {
background-image:url(images/eye.png);
background-position:5px 11px;
background-repeat:no-repeat;
cursor:pointer;
}
/*#widgets-layer-visibility .widgets-this-layer .widgets-empty-layer {
background-image:none;
}*/
#widgets-layer-visibility .widgets-this-layer {cursor:default;}
#widgets-layer-visibility .widgets-other-layer.off, #widgets-layer-visibility .widgets-other-layer.off:hover {
background-position:5px -17px;

View File

@@ -2,6 +2,7 @@
Style.Require("WidgetsAdmin");
Layout.Title = T("Manage Widgets").ToString();
}
@Display.WidgetPlacement_Orphans(OrphanWidgets: Model.OrphanWidgets)
<div id="widgets" class="group">
@Display.WidgetLayersControl(Layers: Model.Layers, CurrentLayer: Model.CurrentLayer)
<div id="layout-widgets-placement">

View File

@@ -1,13 +0,0 @@
@{
Layout.Title = Model.Title;
}
@if(Model.Content != null) {
<article>
@if(Model.Header != null) {
<header>
@Display(Model.Header)
</header>
}
@Display(Model.Content)
</article>
}

View File

@@ -32,7 +32,7 @@
layer.data("widgets", layersWidgets);
}
else {
layer = $("<li class=\"widgets-empty-layer\">" + layers[i].name + " <span>[empty]<span></li>");
layer = $("<li class=\"widgets-empty-layer" + ((layers[i].id == currentLayerId && " widgets-this-layer") || "") + "\">" + layers[i].name + " <span>[empty]<span></li>");
}
visContainer.append(layer);

View File

@@ -0,0 +1,23 @@
@using Orchard.Utility.Extensions;
@using Orchard.Widgets.Models;
@{
Style.Require("WidgetsAdmin");
IEnumerable<WidgetPart> widgets = Model.OrphanWidgets;
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
}
@if (widgets.Count() > 0) {
<div id="widgets-orphans" class="widgets-container widgets-listed message-Warning">
<h3>@T("Widgets with problems.")</h3>
<p>@T("These widgets aren't going to appear anywhere because they're missing the CommonPart from their content type. To fix these widgets, if you still want to keep them around, start by fixing their <a href=\"{0}\">Content Types</a>.", Url.Action("Index", "Admin", new { area = "Orchard.ContentTypes" }))</p>
<ul>
@foreach (WidgetPart widget in widgets) {
<li class="@(widget == widgets.First() ? "first" : (widget == widgets.Last() ? "last" : ""))">
<h3>@Html.ActionLink(HasText(widget.Title) ? widget.Title : widget.TypeDefinition.DisplayName, "EditWidget", new { @widget.Id, returnUrl })</h3>
<div class="widgets-actions">
<button name="moveOut" value="@widget.Id" class="link" type="submit">@T("Remove")</button>
</div>
</li>
}
</ul>
</div>
}

View File

@@ -9,16 +9,16 @@
}
<div id="widgets-placement">
<div id="widgets-layers" class="widgets-container detail-view switchable">
<div id="widgets-zones">
<div id="widgets-zones" class="widgets-listed">
@using (Html.BeginFormAntiForgeryPost()) {
@Display.WidgetPlacement_Zones(Widgets: Model.Widgets, Zones: Model.Zones, CurrentLayer: Model.CurrentLayer)
}
</div>
@if (orphanZones.Count() > 0) {
<div id="widgets-zones-orphans">
<div id="widgets-zones-orphans-container">
<h3>@T("Zones for other enabled themes.")</h3>
<p>@T("Widgets in these zones will not appear anywhere when your currently active theme is applied. They might still appear in selectively applied (e.g. mobile) themes.")</p>
<div id="widgets-zones">
<div id="widgets-zones-orphans" class="widgets-listed">
@using (Html.BeginFormAntiForgeryPost()) {
@Display.WidgetPlacement_Zones(Widgets: Model.Widgets, Zones: Model.OrphanZones, CurrentLayer: Model.CurrentLayer)
}

View File

@@ -144,9 +144,9 @@
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Orchard.Startup\Orchard.Startup.csproj">
<ProjectReference Include="..\Orchard.Startup\Orchard.WarmupStarter.csproj">
<Project>{5C0D5249-AEF5-4BB6-8F5F-057B91AC2D7A}</Project>
<Name>Orchard.Startup</Name>
<Name>Orchard.WarmupStarter</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard\Orchard.Framework.csproj">
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
@@ -173,6 +173,31 @@
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target> -->
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CustomCollectFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
</PropertyGroup>
<Target Name="CustomCollectFiles">
<ItemGroup>
<Orchard-Web-Bins Include="bin\*" />
<SqlCeBinariesx86 Include="..\..\lib\sqlce\x86\**\*" />
<SqlCeBinariesx64 Include="..\..\lib\sqlce\amd64\**\*" />
<_CustomFiles Include="Modules\**\*;Themes\**\*;Core\**\*;**\*.po" Exclude="**\obj\**;@(Orchard-Web-Bins -> '**\%(Filename)%(Extension)');**\*.csproj.user;**\*.hg*" />
<FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
<DestinationRelativePath>%(RelativeDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
<_SqlCeBinariesx86Files Include="@(SqlCeBinariesx86);" />
<FilesForPackagingFromProject Include="%(_SqlCeBinariesx86Files.Identity)">
<DestinationRelativePath>bin\x86\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
<_SqlCeBinariesx64Files Include="@(SqlCeBinariesx64);" />
<FilesForPackagingFromProject Include="%(_SqlCeBinariesx64Files.Identity)">
<DestinationRelativePath>bin\amd64\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
<Target Name="CopySqlCeBinaries">
<ItemGroup>
<SqlCeBinariesx86 Include="$(ProjectDir)..\..\lib\sqlce\x86\**\*" />

View File

@@ -783,11 +783,7 @@ button.link {
text-align:right;
}
.item-properties.actions {
/*margin-bottom:.5em;
margin-top:-5em;
overflow:hidden;
padding:1px;*/
float:right;
margin: -10px 0 10px 0;
}
.contentItems .actions li {
background:inherit;

View File

@@ -417,6 +417,12 @@ nav ul
.split-124 #footer-quad-fourth { width:480px; } /* If zones 1, 2, 4 are on */
.split-123 #footer-quad-third { width:480px; } /* If zones 1, 2, 3 are on */
/*3 zones on - alternate layout*/
/*.split-123 #footer-quad-first, .split-123 #footer-quad-second, .split-123 #footer-quad-third { width:320px; }*/ /* If zones 1, 2, 3 are on */
/*.split-124 #footer-quad-first, .split-124 #footer-quad-second, .split-124 #footer-quad-fourth { width:320px; }*/ /* If zones 1, 2, 4 are on */
/*.split-134 #footer-quad-first, .split-134 #footer-quad-third, .split-134 #footer-quad-fourth { width:320px; }*/ /* If zones 1, 3, 4 are on */
/*.split-234 #footer-quad-second, .split-234 #footer-quad-third, .split-234 #footer-quad-fourth { width:320px; }*/ /* If zones 2, 3, 4 are on */
/* Widgets

View File

@@ -9,7 +9,8 @@
@{
/* Global includes for the theme
***************************************************************/
SetMeta("X-UA-Compatible", "IE=edge,chrome=1");
Style.Include("http://fonts.googleapis.com/css?family=Lobster&subset=latin");
Style.Include("site.css");

View File

@@ -122,7 +122,7 @@
</httpHandlers>
<httpModules>
<add name="WarmupHttpModule" type="Orchard.Startup.WarmupHttpModule, Orchard.Startup"/>
<add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule, Orchard.WarmupStarter, Version=1.0.20, Culture=neutral"/>
</httpModules>
</system.web>
<!--
@@ -134,7 +134,7 @@
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="WarmupHttpModule" />
<add name="WarmupHttpModule" type="Orchard.Startup.WarmupHttpModule, Orchard.Startup"/>
<add name="WarmupHttpModule" type="Orchard.WarmupStarter.WarmupHttpModule, Orchard.WarmupStarter, Version=1.0.20, Culture=neutral"/>
</modules>
<handlers accessPolicy="Script">
<!-- clear all handlers, prevents executing code file extensions, prevents returning any file contents -->

View File

@@ -114,7 +114,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.ImportExport", "Orc
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Warmup", "Orchard.Web\Modules\Orchard.WarmUp\Orchard.Warmup.csproj", "{9CD5C81F-5828-4384-8474-2E2BE71D5EDD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Startup", "Orchard.Startup\Orchard.Startup.csproj", "{5C0D5249-AEF5-4BB6-8F5F-057B91AC2D7A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.WarmupStarter", "Orchard.Startup\Orchard.WarmupStarter.csproj", "{5C0D5249-AEF5-4BB6-8F5F-057B91AC2D7A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@@ -88,10 +88,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\fluentnhibernate\FluentNHibernate.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.85.5.452, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\sharpziplib\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\fluentnhibernate\log4net.dll</HintPath>