From b7f6e70d29b50ff8785df687f5913c025032f9b5 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Wed, 20 Oct 2010 17:30:30 -0700 Subject: [PATCH 01/14] Handle Azure folder creation - Azure Blobs don't handle folders, have to create a fake "hidden" file entry to simulate the folder exists --HG-- branch : dev --- .../Media/AzureBlobStorageProviderTests.cs | 1 - src/Orchard.Azure/AzureFileSystem.cs | 13 +++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Orchard.Azure.Tests/FileSystems/Media/AzureBlobStorageProviderTests.cs b/src/Orchard.Azure.Tests/FileSystems/Media/AzureBlobStorageProviderTests.cs index 2b2c5baab..2e08c6174 100644 --- a/src/Orchard.Azure.Tests/FileSystems/Media/AzureBlobStorageProviderTests.cs +++ b/src/Orchard.Azure.Tests/FileSystems/Media/AzureBlobStorageProviderTests.cs @@ -88,7 +88,6 @@ namespace Orchard.Azure.Tests.FileSystems.Media { [Test] [ExpectedException(typeof(ArgumentException))] public void CreateFolderThatExistsShouldThrow() { - // sebros: In Azure, the folder concept is just about checking files prefix. So until a file exists, a folder is nothing _azureBlobStorageProvider.CreateFile("folder/foo.txt"); _azureBlobStorageProvider.CreateFolder("folder"); } diff --git a/src/Orchard.Azure/AzureFileSystem.cs b/src/Orchard.Azure/AzureFileSystem.cs index 6de706353..958464db4 100644 --- a/src/Orchard.Azure/AzureFileSystem.cs +++ b/src/Orchard.Azure/AzureFileSystem.cs @@ -8,7 +8,10 @@ using Microsoft.WindowsAzure.StorageClient; using Orchard.FileSystems.Media; namespace Orchard.Azure { - public class AzureFileSystem { + public class AzureFileSystem + { + private const string FolderEntry = "$$$ORCHARD$$$.$$$"; + public string ContainerName { get; protected set; } private readonly CloudStorageAccount _storageAccount; @@ -79,6 +82,10 @@ namespace Orchard.Azure { { foreach (var blobItem in BlobClient.ListBlobsWithPrefix(prefix).OfType()) { + // ignore directory entries + if(blobItem.Uri.AbsoluteUri.EndsWith(FolderEntry)) + continue; + yield return new AzureBlobFileStorage(blobItem); } } @@ -117,7 +124,9 @@ namespace Orchard.Azure { using (new HttpContextWeaver()) { Container.EnsureDirectoryDoesNotExist(path); - Container.GetDirectoryReference(path); + + // Creating a virtually hidden file to make the directory an existing concept + CreateFile(path + "/" + FolderEntry); } } From 63e25ef1a8e76a54460fb06c0331a468fa11d893 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Thu, 21 Oct 2010 12:47:40 -0700 Subject: [PATCH 02/14] Correcting Azure blob storage returned values - Paths should be relative for Orchard.Media --HG-- branch : dev --- AzurePackage.proj | 3 +- .../Media/AzureBlobStorageProviderTests.cs | 17 ++- src/Orchard.Azure/AzureFileSystem.cs | 134 ++++++++---------- .../Orchard.Azure.Web/WebRole.cs | 5 + .../Media/FileSystemStorageProvider.cs | 6 +- 5 files changed, 85 insertions(+), 80 deletions(-) diff --git a/AzurePackage.proj b/AzurePackage.proj index 696168b1e..5ae8072d0 100644 --- a/AzurePackage.proj +++ b/AzurePackage.proj @@ -48,7 +48,8 @@ + Properties="Configuration=Release;OutputPath=$(CompileFolder);PlatformTarget=x64;DefineConstants=AZURE" + /> ListFiles(string path) { + path = path ?? String.Empty; + EnsurePathIsRelative(path); string prefix = String.Concat(Container.Name, "/", _root, path); + if ( !prefix.EndsWith("/") ) prefix += "/"; - using ( new HttpContextWeaver() ) - { - foreach (var blobItem in BlobClient.ListBlobsWithPrefix(prefix).OfType()) - { + + using ( new HttpContextWeaver() ) { + foreach (var blobItem in BlobClient.ListBlobsWithPrefix(prefix).OfType()) { // ignore directory entries if(blobItem.Uri.AbsoluteUri.EndsWith(FolderEntry)) continue; - yield return new AzureBlobFileStorage(blobItem); + yield return new AzureBlobFileStorage(blobItem, _absoluteRoot); } } } public IEnumerable ListFolders(string path) { + path = path ?? String.Empty; + EnsurePathIsRelative(path); - path = String.Concat(_root, path); - using ( new HttpContextWeaver() ) - { - if (!Container.DirectoryExists(path)) - { - try - { - CreateFolder(path); + using ( new HttpContextWeaver() ) { + if ( !Container.DirectoryExists(String.Concat(_root, path)) ) { + try { + CreateFolder(String.Concat(_root, path)); } - catch (Exception ex) - { + catch ( Exception ex ) { throw new ArgumentException(string.Format("The folder could not be created at path: {0}. {1}", path, ex)); } } - return Container.GetDirectoryReference(path) + return Container.GetDirectoryReference(String.Concat(_root, path)) .ListBlobs() .OfType() - .Select(d => new AzureBlobFolderStorage(d)) + .Select(d => new AzureBlobFolderStorage(d, _absoluteRoot)) .ToList(); } } @@ -120,10 +117,8 @@ namespace Orchard.Azure { public void CreateFolder(string path) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - using (new HttpContextWeaver()) - { - Container.EnsureDirectoryDoesNotExist(path); + using (new HttpContextWeaver()) { + Container.EnsureDirectoryDoesNotExist(String.Concat(_root, path)); // Creating a virtually hidden file to make the directory an existing concept CreateFile(path + "/" + FolderEntry); @@ -132,13 +127,10 @@ namespace Orchard.Azure { public void DeleteFolder(string path) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - using ( new HttpContextWeaver() ) - { - Container.EnsureDirectoryExists(path); - foreach (var blob in Container.GetDirectoryReference(path).ListBlobs()) - { + using ( new HttpContextWeaver() ) { + Container.EnsureDirectoryExists(String.Concat(_root, path)); + foreach ( var blob in Container.GetDirectoryReference(String.Concat(_root, path)).ListBlobs() ) { if (blob is CloudBlob) ((CloudBlob) blob).Delete(); @@ -150,7 +142,6 @@ namespace Orchard.Azure { public void RenameFolder(string path, string newPath) { EnsurePathIsRelative(path); - EnsurePathIsRelative(newPath); if ( !path.EndsWith("/") ) @@ -158,20 +149,16 @@ namespace Orchard.Azure { if ( !newPath.EndsWith("/") ) newPath += "/"; - using ( new HttpContextWeaver() ) - { - foreach (var blob in Container.GetDirectoryReference(_root + path).ListBlobs()) - { - if (blob is CloudBlob) - { + using ( new HttpContextWeaver() ) { + foreach (var blob in Container.GetDirectoryReference(_root + path).ListBlobs()) { + if (blob is CloudBlob) { string filename = Path.GetFileName(blob.Uri.ToString()); string source = String.Concat(path, filename); string destination = String.Concat(newPath, filename); RenameFile(source, destination); } - if (blob is CloudBlobDirectory) - { + if (blob is CloudBlobDirectory) { string foldername = blob.Uri.Segments.Last(); string source = String.Concat(path, foldername); string destination = String.Concat(newPath, foldername); @@ -183,29 +170,24 @@ namespace Orchard.Azure { public void DeleteFile(string path) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - - using ( new HttpContextWeaver() ) - { + + using ( new HttpContextWeaver() ) { Container.EnsureBlobExists(path); - var blob = Container.GetBlockBlobReference(path); + var blob = Container.GetBlockBlobReference(String.Concat(_root, path)); blob.Delete(); } } public void RenameFile(string path, string newPath) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - EnsurePathIsRelative(newPath); - newPath = String.Concat(_root, newPath); - using ( new HttpContextWeaver() ) - { - Container.EnsureBlobExists(path); - Container.EnsureBlobDoesNotExist(newPath); - var blob = Container.GetBlockBlobReference(path); - var newBlob = Container.GetBlockBlobReference(newPath); + using ( new HttpContextWeaver() ) { + Container.EnsureBlobExists(String.Concat(_root, path)); + Container.EnsureBlobDoesNotExist(String.Concat(_root, newPath)); + + var blob = Container.GetBlockBlobReference(String.Concat(_root, path)); + var newBlob = Container.GetBlockBlobReference(String.Concat(_root, newPath)); newBlob.CopyFromBlob(blob); blob.Delete(); } @@ -213,36 +195,36 @@ namespace Orchard.Azure { public IStorageFile CreateFile(string path) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - if ( Container.BlobExists(path) ) { + if ( Container.BlobExists(String.Concat(_root, path)) ) { throw new ArgumentException("File " + path + " already exists"); } - var blob = Container.GetBlockBlobReference(path); + var blob = Container.GetBlockBlobReference(String.Concat(_root, path)); blob.OpenWrite().Dispose(); // force file creation - return new AzureBlobFileStorage(blob); + return new AzureBlobFileStorage(blob, _absoluteRoot); } public string GetPublicUrl(string path) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - using ( new HttpContextWeaver() ) - { - Container.EnsureBlobExists(path); - return Container.GetBlockBlobReference(path).Uri.ToString(); + + using ( new HttpContextWeaver() ) { + Container.EnsureBlobExists(String.Concat(_root, path)); + return Container.GetBlockBlobReference(String.Concat(_root, path)).Uri.ToString(); } } private class AzureBlobFileStorage : IStorageFile { private readonly CloudBlockBlob _blob; + private readonly string _rootPath; - public AzureBlobFileStorage(CloudBlockBlob blob) { + public AzureBlobFileStorage(CloudBlockBlob blob, string rootPath) { _blob = blob; + _rootPath = rootPath; } public string GetPath() { - return _blob.Uri.ToString(); + return _blob.Uri.ToString().Substring(_rootPath.Length+1); } public string GetName() { @@ -273,17 +255,19 @@ namespace Orchard.Azure { private class AzureBlobFolderStorage : IStorageFolder { private readonly CloudBlobDirectory _blob; + private readonly string _rootPath; - public AzureBlobFolderStorage(CloudBlobDirectory blob) { + public AzureBlobFolderStorage(CloudBlobDirectory blob, string rootPath) { _blob = blob; + _rootPath = rootPath; } public string GetName() { - return Path.GetDirectoryName(_blob.Uri.ToString()); + return Path.GetDirectoryName(GetPath() + "/"); } public string GetPath() { - return _blob.Uri.ToString(); + return _blob.Uri.ToString().Substring(_rootPath.Length + 1).TrimEnd('/'); } public long GetSize() { @@ -296,7 +280,7 @@ namespace Orchard.Azure { public IStorageFolder GetParent() { if ( _blob.Parent != null ) { - return new AzureBlobFolderStorage(_blob.Parent); + return new AzureBlobFolderStorage(_blob.Parent, _rootPath); } throw new ArgumentException("Directory " + _blob.Uri + " does not have a parent directory"); } diff --git a/src/Orchard.Azure/Orchard.Azure.Web/WebRole.cs b/src/Orchard.Azure/Orchard.Azure.Web/WebRole.cs index 832917606..ad0306387 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/WebRole.cs +++ b/src/Orchard.Azure/Orchard.Azure.Web/WebRole.cs @@ -8,6 +8,11 @@ namespace Orchard.Azure.Web { public override bool OnStart() { DiagnosticMonitor.Start("DiagnosticsConnectionString"); + CloudStorageAccount.SetConfigurationSettingPublisher( + (configName, configSetter) => + configSetter(RoleEnvironment.GetConfigurationSettingValue(configName)) + ); + // For information on handling configuration changes // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357. RoleEnvironment.Changing += RoleEnvironmentChanging; diff --git a/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs b/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs index 7f0817619..a0b914428 100644 --- a/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs +++ b/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs @@ -1,4 +1,5 @@ -using System; +#if !AZURE +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -248,4 +249,5 @@ namespace Orchard.FileSystems.Media { } } -} \ No newline at end of file +} +#endif \ No newline at end of file From a733ca09c70c2dceab1e949037b88b7622dad15b Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Thu, 28 Oct 2010 16:12:15 -0700 Subject: [PATCH 03/14] Fixing version numbers in gallery --HG-- branch : dev --- .../Controllers/FeedController.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Tools/PackageIndexReferenceImplementation/Controllers/FeedController.cs b/src/Tools/PackageIndexReferenceImplementation/Controllers/FeedController.cs index 06d6ef74b..9bcdaf383 100644 --- a/src/Tools/PackageIndexReferenceImplementation/Controllers/FeedController.cs +++ b/src/Tools/PackageIndexReferenceImplementation/Controllers/FeedController.cs @@ -16,6 +16,9 @@ using PackageIndexReferenceImplementation.Services; namespace PackageIndexReferenceImplementation.Controllers { [HandleError] public class FeedController : Controller { + private const string VersionTag = "Version"; + private const string ExtensionsNamespace = "http://orchardproject.net"; + private readonly FeedStorage _feedStorage; private readonly MediaStorage _mediaStorage; @@ -104,7 +107,12 @@ namespace PackageIndexReferenceImplementation.Controllers { } if ( !string.IsNullOrEmpty(packageProperties.Version) ) { - item.ElementExtensions.Add("Version", "http://orchardproject.net", packageProperties.Version); + var versionExtensions = item.ElementExtensions.Where(e => e.OuterName == VersionTag && e.OuterNamespace == ExtensionsNamespace); + foreach(var versionExtension in versionExtensions) { + item.ElementExtensions.Remove(versionExtension); + } + + item.ElementExtensions.Add(VersionTag, ExtensionsNamespace, packageProperties.Version); } var mediaIdentifier = packageProperties.Identifier + "-" + packageProperties.Version + ".zip"; From f0968a0c710534baecd99b7327e06165c60932ae Mon Sep 17 00:00:00 2001 From: dareed Date: Tue, 2 Nov 2010 18:12:44 -0700 Subject: [PATCH 04/14] - root web.config removes all handlers and makes all paths a 404, except default.asp to support "/". - content directories no opt-in to static files only. - module web.configs no longer need to explicitly exclude cshtml, etc, paths. --HG-- branch : dev --- .../Hosting/Orchard.Web/Themes/Web.config | 5 ---- src/Orchard.Web/Core/Common/Views/Web.config | 4 --- .../Core/Contents/Views/Web.config | 4 --- .../Core/Dashboard/Views/Web.config | 4 --- .../Core/Localization/Styles/Web.config | 18 ++++++++++++ .../Core/Localization/Views/Web.config | 4 --- .../Core/Messaging/Views/Web.config | 4 --- .../Core/Navigation/Views/Web.config | 4 --- src/Orchard.Web/Core/Orchard.Core.csproj | 15 ++++++++++ src/Orchard.Web/Core/Reports/Views/Web.config | 4 --- .../Core/Routable/Scripts/Web.config | 18 ++++++++++++ .../Core/Routable/Views/Web.config | 4 --- .../Core/Settings/Styles/Web.config | 18 ++++++++++++ .../Core/Settings/Views/Web.config | 4 --- .../Core/Shapes/Scripts/Web.config | 18 ++++++++++++ src/Orchard.Web/Core/Shapes/Styles/Web.config | 18 ++++++++++++ src/Orchard.Web/Core/Shapes/Views/Web.config | 4 --- .../Orchard.ArchiveLater/Content/Web.config | 18 ++++++++++++ .../Orchard.ArchiveLater.csproj | 10 +++++++ .../Orchard.ArchiveLater/Styles/Web.config | 18 ++++++++++++ .../Orchard.ArchiveLater/Views/Web.config | 4 --- .../Modules/Orchard.Blogs/Content/Web.config | 18 ++++++++++++ .../Orchard.Blogs/Orchard.Blogs.csproj | 9 ++++++ .../Modules/Orchard.Blogs/Scripts/Web.config | 18 ++++++++++++ .../Modules/Orchard.Blogs/Styles/Web.config | 18 ++++++++++++ .../Modules/Orchard.Blogs/Views/Web.config | 4 --- .../StaticFilesWebConfig.txt | 18 ++++++++++++ .../ViewsWebConfig.txt | 4 --- .../Commands/CodeGenerationCommands.cs | 10 ++++++- .../Orchard.CodeGeneration.csproj | 1 + .../Modules/Orchard.Comments/Views/Web.config | 4 --- .../Orchard.ContentTypes.csproj | 6 +++- .../Orchard.ContentTypes/Styles/Web.config | 18 ++++++++++++ .../Orchard.ContentTypes/Views/Web.config | 3 -- .../Modules/Orchard.Email/Views/Web.config | 4 --- .../Orchard.Experimental/Views/Web.config | 3 -- .../Modules/Orchard.Indexing/Views/Web.config | 4 --- .../Modules/Orchard.Media/Content/Web.config | 18 ++++++++++++ .../Orchard.Media/Orchard.Media.csproj | 10 +++++++ .../Modules/Orchard.Media/Styles/Web.config | 18 ++++++++++++ .../Modules/Orchard.Media/Views/Web.config | 4 --- .../Orchard.Migrations/Views/Web.config | 3 -- .../Orchard.Modules/Content/Web.config | 18 ++++++++++++ .../Orchard.Modules/Orchard.Modules.csproj | 11 ++++++- .../Modules/Orchard.Modules/Views/Web.config | 4 --- .../Modules/Orchard.Modules/styles/Web.config | 18 ++++++++++++ .../Orchard.MultiTenancy/Content/Web.config | 18 ++++++++++++ .../Orchard.MultiTenancy.csproj | 10 +++++++ .../Orchard.MultiTenancy/Styles/Web.config | 18 ++++++++++++ .../Orchard.MultiTenancy/Views/Web.config | 4 --- .../Orchard.Packaging/Content/Web.config | 18 ++++++++++++ .../Orchard.Packaging.csproj | 17 +++++++++-- .../Orchard.Packaging/Scripts/Web.config | 18 ++++++++++++ .../Orchard.Packaging/Styles/Web.config | 18 ++++++++++++ .../Orchard.Packaging/Views/Web.config | 3 -- .../Orchard.PublishLater/Content/Web.config | 18 ++++++++++++ .../Orchard.PublishLater.csproj | 11 ++++++- .../Orchard.PublishLater/Styles/Web.config | 18 ++++++++++++ .../Orchard.PublishLater/Views/Web.config | 4 --- .../Modules/Orchard.Roles/Content/Web.config | 18 ++++++++++++ .../Orchard.Roles/Orchard.Roles.csproj | 5 ++++ .../Modules/Orchard.Roles/Views/Web.config | 4 --- .../Orchard.Search/Orchard.Search.csproj | 5 ++++ .../Modules/Orchard.Search/Styles/Web.config | 18 ++++++++++++ .../Modules/Orchard.Search/Views/Web.config | 4 --- .../Modules/Orchard.Setup/Views/Web.config | 4 --- .../Modules/Orchard.Tags/Views/Web.config | 4 --- .../Modules/Orchard.Themes/Content/Web.config | 18 ++++++++++++ .../Orchard.Themes/Orchard.Themes.csproj | 10 +++++++ .../Modules/Orchard.Themes/Styles/Web.config | 18 ++++++++++++ .../Modules/Orchard.Themes/Views/Web.config | 4 --- .../Modules/Orchard.Users/Content/Web.config | 18 ++++++++++++ .../Orchard.Users/Orchard.Users.csproj | 5 ++++ .../Modules/Orchard.Users/Views/Web.config | 4 --- .../Orchard.Widgets/Content/Web.config | 18 ++++++++++++ .../Orchard.Widgets/Orchard.Widgets.csproj | 10 +++++++ .../Modules/Orchard.Widgets/Styles/Web.config | 18 ++++++++++++ .../Modules/Orchard.Widgets/Views/Web.config | 4 --- .../Orchard.jQuery/Orchard.jQuery.csproj | 10 +++++++ .../Modules/Orchard.jQuery/Scripts/Web.config | 18 ++++++++++++ .../Modules/Orchard.jQuery/Styles/Web.config | 18 ++++++++++++ .../Modules/TinyMce/Scripts/Web.config | 18 ++++++++++++ .../Modules/TinyMce/TinyMce.csproj | 5 ++++ .../Modules/TinyMce/Views/Web.config | 4 --- src/Orchard.Web/Orchard.Web.csproj | 2 ++ .../Themes/SafeMode/Content/Web.config | 18 ++++++++++++ .../Themes/SafeMode/Styles/Web.config | 18 ++++++++++++ .../Themes/TheAdmin/Scripts/Web.config | 18 ++++++++++++ .../Themes/TheAdmin/Styles/Web.config | 18 ++++++++++++ .../Themes/TheThemeMachine/Styles/Web.config | 18 ++++++++++++ src/Orchard.Web/Themes/Themes.csproj | 25 ++++++++++++++-- src/Orchard.Web/Themes/Web.config | 7 ----- src/Orchard.Web/Web.config | 29 +++++++++---------- 93 files changed, 877 insertions(+), 159 deletions(-) create mode 100644 src/Orchard.Web/Core/Localization/Styles/Web.config create mode 100644 src/Orchard.Web/Core/Routable/Scripts/Web.config create mode 100644 src/Orchard.Web/Core/Settings/Styles/Web.config create mode 100644 src/Orchard.Web/Core/Shapes/Scripts/Web.config create mode 100644 src/Orchard.Web/Core/Shapes/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.ArchiveLater/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.ArchiveLater/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Scripts/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Blogs/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/StaticFilesWebConfig.txt create mode 100644 src/Orchard.Web/Modules/Orchard.ContentTypes/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Media/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Media/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Modules/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Modules/styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.MultiTenancy/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Packaging/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Packaging/Scripts/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Packaging/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.PublishLater/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.PublishLater/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Roles/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Search/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Themes/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Themes/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Users/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Widgets/Content/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.Widgets/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.jQuery/Scripts/Web.config create mode 100644 src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config create mode 100644 src/Orchard.Web/Modules/TinyMce/Scripts/Web.config create mode 100644 src/Orchard.Web/Themes/SafeMode/Content/Web.config create mode 100644 src/Orchard.Web/Themes/SafeMode/Styles/Web.config create mode 100644 src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config create mode 100644 src/Orchard.Web/Themes/TheAdmin/Styles/Web.config create mode 100644 src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config index f2f307586..dd900f1a0 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config @@ -2,9 +2,6 @@ - - - + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Localization/Views/Web.config b/src/Orchard.Web/Core/Localization/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Core/Localization/Views/Web.config +++ b/src/Orchard.Web/Core/Localization/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Routable/Views/Web.config b/src/Orchard.Web/Core/Routable/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Core/Routable/Views/Web.config +++ b/src/Orchard.Web/Core/Routable/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Settings/Views/Web.config b/src/Orchard.Web/Core/Settings/Views/Web.config index bf2230060..dd900f1a0 100644 --- a/src/Orchard.Web/Core/Settings/Views/Web.config +++ b/src/Orchard.Web/Core/Settings/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Shapes/Styles/Web.config b/src/Orchard.Web/Core/Shapes/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Core/Shapes/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Shapes/Views/Web.config b/src/Orchard.Web/Core/Shapes/Views/Web.config index bf2230060..dd900f1a0 100644 --- a/src/Orchard.Web/Core/Shapes/Views/Web.config +++ b/src/Orchard.Web/Core/Shapes/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj index d63ddfbbf..8e940f29b 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj @@ -106,6 +106,16 @@ Designer + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Views/Web.config b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Views/Web.config index 1295710ba..9a4455a74 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj index 1b1b04662..559c464e6 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj @@ -163,6 +163,15 @@ + + Designer + + + Designer + + + Designer + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Scripts/Web.config b/src/Orchard.Web/Modules/Orchard.Blogs/Scripts/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Scripts/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.Blogs/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Web.config index bf2230060..dd900f1a0 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ViewsWebConfig.txt b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ViewsWebConfig.txt index 7022197d4..260e8318d 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ViewsWebConfig.txt +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ViewsWebConfig.txt @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Web.config b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Web.config index 3e2ccce91..271dd8ba1 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Web.config @@ -3,7 +3,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj b/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj index 510d90e22..c05016a4d 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj +++ b/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj @@ -114,6 +114,16 @@ + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Media/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Media/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Media/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj b/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj index e256af8af..de341021d 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj +++ b/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj @@ -107,7 +107,16 @@ - + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Content/Web.config b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Content/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Content/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj index 016579f15..08c09b778 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj @@ -101,6 +101,16 @@ False + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config index bf2230060..dd900f1a0 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj b/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj index ef1c9d653..507a9889e 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj @@ -108,9 +108,7 @@ - - @@ -124,6 +122,21 @@ + + + Designer + + + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.Packaging/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config index 3e2ccce91..271dd8ba1 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config @@ -3,7 +3,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Orchard.PublishLater.csproj b/src/Orchard.Web/Modules/Orchard.PublishLater/Orchard.PublishLater.csproj index 40a706eda..05e35b33d 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Orchard.PublishLater.csproj +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Orchard.PublishLater.csproj @@ -83,7 +83,11 @@ - + + + Designer + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} @@ -123,6 +127,11 @@ Designer + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj b/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj index 2391a5824..a7e4b54fa 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj +++ b/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj @@ -112,6 +112,11 @@ + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Themes/Orchard.Themes.csproj b/src/Orchard.Web/Modules/Orchard.Themes/Orchard.Themes.csproj index 676a70308..7b94e495a 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/Orchard.Themes.csproj +++ b/src/Orchard.Web/Modules/Orchard.Themes/Orchard.Themes.csproj @@ -109,6 +109,16 @@ + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config index bf2230060..dd900f1a0 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj b/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj index e78ca1397..6694e6de6 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj +++ b/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj @@ -123,6 +123,11 @@ Designer + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj index ea6196de0..df01b5954 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj @@ -127,6 +127,16 @@ + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config index d52f8e346..1f92a3531 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/TinyMce/Scripts/Web.config b/src/Orchard.Web/Modules/TinyMce/Scripts/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/TinyMce/Scripts/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/TinyMce/TinyMce.csproj b/src/Orchard.Web/Modules/TinyMce/TinyMce.csproj index 9e5c17b6d..a66089192 100644 --- a/src/Orchard.Web/Modules/TinyMce/TinyMce.csproj +++ b/src/Orchard.Web/Modules/TinyMce/TinyMce.csproj @@ -159,6 +159,11 @@ + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Themes/SafeMode/Styles/Web.config b/src/Orchard.Web/Themes/SafeMode/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Themes/SafeMode/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config b/src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/Web.config b/src/Orchard.Web/Themes/TheAdmin/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Themes/TheAdmin/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Themes/Themes.csproj b/src/Orchard.Web/Themes/Themes.csproj index 7d12ed2ce..e5e154151 100644 --- a/src/Orchard.Web/Themes/Themes.csproj +++ b/src/Orchard.Web/Themes/Themes.csproj @@ -58,9 +58,15 @@ - + Designer + + Designer + + + Designer + @@ -94,7 +100,22 @@ - + + + + + Designer + + + + + Designer + + + + + Designer + diff --git a/src/Orchard.Web/Themes/Web.config b/src/Orchard.Web/Themes/Web.config index ae3d47d77..dd900f1a0 100644 --- a/src/Orchard.Web/Themes/Web.config +++ b/src/Orchard.Web/Themes/Web.config @@ -2,11 +2,6 @@ - - - - - - - + + + + + - - - - - - - - - - + + + + + + + + From 1dff42d55e8434b9095a7ac6b23ca166ffa8fb4b Mon Sep 17 00:00:00 2001 From: Dave Reed Date: Wed, 3 Nov 2010 12:08:34 -0700 Subject: [PATCH 05/14] Fixed missing media/web.config file from previous commit --HG-- branch : dev --- src/Orchard.Web/Media/web.config | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/Orchard.Web/Media/web.config diff --git a/src/Orchard.Web/Media/web.config b/src/Orchard.Web/Media/web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Media/web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + From 30a211cfb972b4589161412b74f0a768c17578cc Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Wed, 3 Nov 2010 16:28:27 -0700 Subject: [PATCH 06/14] Improved a data migration test to ensure the default values are written in the db - Provides an example to check the db using a SQL query --HG-- branch : dev extra : transplant_source : %24%2B%3A%0D%E0%7F%D5%D1Wl%1Bx%13%017%ED%9A%D8%A6%D0 --- .../DataMigration/SchemaBuilderTests.cs | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Orchard.Tests/DataMigration/SchemaBuilderTests.cs b/src/Orchard.Tests/DataMigration/SchemaBuilderTests.cs index fdbc736fc..bc9e28ff7 100644 --- a/src/Orchard.Tests/DataMigration/SchemaBuilderTests.cs +++ b/src/Orchard.Tests/DataMigration/SchemaBuilderTests.cs @@ -26,6 +26,7 @@ namespace Orchard.Tests.DataMigration { private string _tempFolder; private SchemaBuilder _schemaBuilder; private DefaultDataMigrationInterpreter _interpreter; + private ISession _session; [SetUp] public void Setup() { @@ -38,7 +39,7 @@ namespace Orchard.Tests.DataMigration { var builder = new ContainerBuilder(); - var session = _sessionFactory.OpenSession(); + _session = _sessionFactory.OpenSession(); builder.RegisterInstance(appDataFolder).As(); builder.RegisterType().As(); builder.RegisterType().As(); @@ -46,7 +47,7 @@ namespace Orchard.Tests.DataMigration { builder.RegisterType().As(); builder.RegisterType().As(); builder.RegisterType().As(); - builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(session)).As(); + builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As(); builder.RegisterInstance(new ShellBlueprint { Records = Enumerable.Empty() }).As(); builder.RegisterInstance(new ShellSettings { Name = "temp", DataProvider = "SqlCe", DataTablePrefix = "TEST" }).As(); builder.RegisterModule(new DataModule()); @@ -133,10 +134,24 @@ namespace Orchard.Tests.DataMigration { .AlterTable("User", table => table .AddColumn("Age", DbType.Int32)) .AlterTable("User", table => table - .AlterColumn("Lastname", column => column.WithDefault("John"))) + .AlterColumn("Lastname", column => column.WithDefault("Doe"))) .AlterTable("User", table => table .DropColumn("Firstname") ); + + // creating a new row should assign a default value to Firstname and Age + _schemaBuilder + .ExecuteSql("insert into TEST_User VALUES (DEFAULT, DEFAULT)"); + + // ensure wehave one record woth the default value + var command = _session.Connection.CreateCommand(); + command.CommandText = "SELECT count(*) FROM TEST_User WHERE Lastname = 'Doe'"; + Assert.That(command.ExecuteScalar(), Is.EqualTo(1)); + + // ensure this is not a false positive + command = _session.Connection.CreateCommand(); + command.CommandText = "SELECT count(*) FROM TEST_User WHERE Lastname = 'Foo'"; + Assert.That(command.ExecuteScalar(), Is.EqualTo(0)); } [Test] From e299284eb184c8275f02d36ea17cff83b8bbe595 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Wed, 3 Nov 2010 22:33:27 -0700 Subject: [PATCH 07/14] Placing the content localization edit template beneath the route part's edit template --HG-- branch : dev --- src/Orchard.Web/Core/Localization/Placement.info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orchard.Web/Core/Localization/Placement.info b/src/Orchard.Web/Core/Localization/Placement.info index d06608e6c..963f7a8c7 100644 --- a/src/Orchard.Web/Core/Localization/Placement.info +++ b/src/Orchard.Web/Core/Localization/Placement.info @@ -6,7 +6,7 @@ Parts_Localization_ContentTranslations_SummaryAdmin --> - + From b73e125ab47a6d5e33fe3b5f496183784023a4f4 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Wed, 3 Nov 2010 23:03:34 -0700 Subject: [PATCH 08/14] Bringing back the Feature management's view switcher --HG-- branch : dev --- src/Orchard.Web/Core/Orchard.Core.csproj | 1 - src/Orchard.Web/Core/Shapes/ResourceManifest.cs | 9 +++++---- src/Orchard.Web/Core/Shapes/Views/UI/Switchable.cshtml | 5 ----- .../Modules/Orchard.Modules/Views/Admin/Features.cshtml | 5 +++-- .../Modules/Orchard.Themes/ResourceManifest.cs | 3 --- 5 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 src/Orchard.Web/Core/Shapes/Views/UI/Switchable.cshtml diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index f74e81b86..7c5f82b34 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -298,7 +298,6 @@ - diff --git a/src/Orchard.Web/Core/Shapes/ResourceManifest.cs b/src/Orchard.Web/Core/Shapes/ResourceManifest.cs index cb6505345..656acaf5c 100644 --- a/src/Orchard.Web/Core/Shapes/ResourceManifest.cs +++ b/src/Orchard.Web/Core/Shapes/ResourceManifest.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using Orchard.UI.Resources; namespace Orchard.Core.Shapes { @@ -11,6 +7,11 @@ namespace Orchard.Core.Shapes { manifest.DefineScript("ShapesBase").SetUrl("base.js").SetDependencies("jQuery"); manifest.DefineStyle("Shapes").SetUrl("site.css"); // todo: missing manifest.DefineStyle("ShapesSpecial").SetUrl("special.css"); + + manifest.DefineScript("Switchable").SetUrl("jquery.switchable.js") + .SetDependencies("jQuery") + .SetDependencies("ShapesBase"); + manifest.DefineStyle("Switchable").SetUrl("jquery.switchable.css"); } } } diff --git a/src/Orchard.Web/Core/Shapes/Views/UI/Switchable.cshtml b/src/Orchard.Web/Core/Shapes/Views/UI/Switchable.cshtml deleted file mode 100644 index 8f3d5b92c..000000000 --- a/src/Orchard.Web/Core/Shapes/Views/UI/Switchable.cshtml +++ /dev/null @@ -1,5 +0,0 @@ -@{ - Style.Require("Switchable"); - Script.Require("Switchable"); -} -@string.Format("{0} switchable", Model) \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Features.cshtml b/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Features.cshtml index 673f34b24..839aa448d 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Features.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Modules/Views/Admin/Features.cshtml @@ -4,14 +4,15 @@ @using Orchard.Modules.ViewModels; @using Orchard.Utility.Extensions; @using Orchard.Modules.Models; - @{ Style.Require("ModulesAdmin"); + Style.Require("Switchable"); + Script.Require("Switchable"); }

@Html.TitleForPage(T("Manage Features").ToString())

@if (Model.Features.Count() > 0) { -
    @{ +
      @{ var featureGroups = Model.Features.OrderBy(f => f.Descriptor.Category, new DoghouseComparer("Core")).GroupBy(f => f.Descriptor.Category); foreach (var featureGroup in featureGroups) { var categoryName = LocalizedString.TextOrDefault(featureGroup.First().Descriptor.Category, T("Uncategorized")); diff --git a/src/Orchard.Web/Modules/Orchard.Themes/ResourceManifest.cs b/src/Orchard.Web/Modules/Orchard.Themes/ResourceManifest.cs index 720cd4688..884143c24 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/ResourceManifest.cs +++ b/src/Orchard.Web/Modules/Orchard.Themes/ResourceManifest.cs @@ -6,9 +6,6 @@ namespace Orchard.Themes { public void BuildManifests(ResourceManifestBuilder builder) { var manifest = builder.Add(); manifest.DefineStyle("ThemesAdmin").SetUrl("admin.css"); - // todo: used by core\shapes -- move it? - manifest.DefineScript("Switchable").SetUrl("jquery.switchable.js").SetDependencies("jQuery"); - manifest.DefineStyle("Switchable").SetUrl("jquery.switchable.css"); // todo: include and define the min.js version too // todo: move EasySlider to common location, although it does not appear to be used anywhere right now From 9a5faa199f985ff5acd4f61de44e6dfa05e4885a Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Wed, 3 Nov 2010 23:11:14 -0700 Subject: [PATCH 09/14] Removing the "caption" input from the media edit template --HG-- branch : dev --- .../Orchard.Media/Controllers/AdminController.cs | 5 +++-- .../Orchard.Media/Views/Admin/EditMedia.cshtml | 11 ++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs index 42be7e649..d7b0b0d21 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs @@ -195,10 +195,11 @@ namespace Orchard.Media.Controllers { } } - public ActionResult EditMedia(string name, string caption, DateTime lastUpdated, long size, string folderName, string mediaPath) { + public ActionResult EditMedia(string name, DateTime lastUpdated, long size, string folderName, string mediaPath) { var model = new MediaItemEditViewModel(); model.Name = name; - model.Caption = caption ?? String.Empty; + // todo: reimplement + //model.Caption = caption ?? String.Empty; model.LastUpdated = lastUpdated; model.Size = size; model.FolderName = folderName; diff --git a/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml b/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml index 6f1ac4f0d..efbbc1b68 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml @@ -19,7 +19,7 @@ @Html.ValidationSummary()
      - @Model.Caption +
      @* todo: make these real (including markup) *@ @@ -32,7 +32,7 @@
      - + @T("Copy this html to add this image to your site.")
      @@ -42,9 +42,6 @@
      - - - @T("This will be used for the image alt tag.") @@ -58,7 +55,7 @@ @*

      @T("Preview")

      -
      @Model.Caption
      +
        @// todo: make these real (including markup)
      • @@ -66,7 +63,7 @@
      • - ", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375, Model.Caption)" /> + ", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375)" /> @T("Copy this html to add this image to your site.")

      From 8326f4f61d870d6fd372aa1f787d5e92134c8020 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Wed, 3 Nov 2010 23:37:49 -0700 Subject: [PATCH 10/14] Fixing Media's GetPublicUrl --HG-- branch : dev --- src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs b/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs index a0b914428..94109df69 100644 --- a/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs +++ b/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs @@ -46,7 +46,7 @@ namespace Orchard.FileSystems.Media { public string GetPublicUrl(string path) { - return _publicPath + path.Replace(Path.DirectorySeparatorChar, '/'); + return Map(_publicPath + path.Replace(Path.DirectorySeparatorChar, '/')); } public IStorageFile GetFile(string path) { From e414469e0fa797f6072142f7413a351bf9b3b052 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Wed, 3 Nov 2010 23:38:12 -0700 Subject: [PATCH 11/14] Fixing the src of media embed markup that's given on the edit media page --HG-- branch : dev --- .../Modules/Orchard.Media/Views/Admin/EditMedia.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml b/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml index efbbc1b68..9dee177e3 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml @@ -32,7 +32,7 @@
      - + @T("Copy this html to add this image to your site.")
      From 79bec8cee635737035c31b60de34e0ff5435b124 Mon Sep 17 00:00:00 2001 From: Dave Reed Date: Thu, 4 Nov 2010 12:01:07 -0700 Subject: [PATCH 12/14] - Added whitelist site setting for allowed file extensions to upload via media module. - Hardcoded blacklist: web.config - Superuser immune to whitelist restriction - Zip files still allowed even if not in the list since these are expanded by the media module to allow for multi upload. - Files within a zip must still pass white/black-list test per normal rules (file is skipped if not). --HG-- branch : dev --- .../Controllers/AdminController.cs | 12 ++++ .../Handlers/MediaSettingsPartHandler.cs | 15 +++++ .../Modules/Orchard.Media/Migrations.cs | 16 +++++ .../Orchard.Media/Models/MediaSettingsPart.cs | 11 ++++ .../Models/MediaSettingsPartRecord.cs | 15 +++++ .../Orchard.Media/Orchard.Media.csproj | 7 ++ .../Orchard.Media/Services/IMediaService.cs | 1 + .../Orchard.Media/Services/MediaService.cs | 64 ++++++++++++++++--- .../ViewModels/MediaItemAddViewModel.cs | 4 +- .../Parts/Media.MediaSettings.cshtml | 9 +++ 10 files changed, 144 insertions(+), 10 deletions(-) create mode 100644 src/Orchard.Web/Modules/Orchard.Media/Handlers/MediaSettingsPartHandler.cs create mode 100644 src/Orchard.Web/Modules/Orchard.Media/Migrations.cs create mode 100644 src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPart.cs create mode 100644 src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs create mode 100644 src/Orchard.Web/Modules/Orchard.Media/Views/EditorTemplates/Parts/Media.MediaSettings.cshtml diff --git a/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs index d7b0b0d21..14d2898fe 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs @@ -3,10 +3,13 @@ using System.Collections.Generic; using System.IO; using System.Web; using System.Web.Mvc; +using JetBrains.Annotations; +using Orchard.ContentManagement; using Orchard.Localization; using Orchard.Media.Models; using Orchard.Media.Services; using Orchard.Media.ViewModels; +using Orchard.Settings; using Orchard.UI.Notify; using Orchard.Utility.Extensions; @@ -153,6 +156,15 @@ namespace Orchard.Media.Controllers { if (!ModelState.IsValid) return View(viewModel); + // first validate them all + foreach (string fileName in Request.Files) { + HttpPostedFileBase file = Request.Files[fileName]; + if (!_mediaService.FileAllowed(file)) { + ModelState.AddModelError("File", T("That file type is not allowed.").ToString()); + return View(viewModel); + } + } + // then save them foreach (string fileName in Request.Files) { HttpPostedFileBase file = Request.Files[fileName]; _mediaService.UploadMediaFile(viewModel.MediaPath, file); diff --git a/src/Orchard.Web/Modules/Orchard.Media/Handlers/MediaSettingsPartHandler.cs b/src/Orchard.Web/Modules/Orchard.Media/Handlers/MediaSettingsPartHandler.cs new file mode 100644 index 000000000..dd480a4c9 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Media/Handlers/MediaSettingsPartHandler.cs @@ -0,0 +1,15 @@ +using JetBrains.Annotations; +using Orchard.Data; +using Orchard.ContentManagement.Handlers; +using Orchard.Media.Models; + +namespace Orchard.Media.Handlers { + [UsedImplicitly] + public class MediaSettingsPartHandler : ContentHandler { + public MediaSettingsPartHandler(IRepository repository) { + Filters.Add(new ActivatingFilter("Site")); + Filters.Add(StorageFilter.For(repository)); + Filters.Add(new TemplateFilterForRecord("MediaSettings", "Parts/Media.MediaSettings")); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Media/Migrations.cs new file mode 100644 index 000000000..0830945b6 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Media/Migrations.cs @@ -0,0 +1,16 @@ +using Orchard.Data.Migration; +using Orchard.Media.Models; + +namespace Orchard.Media { + public class MediaDataMigration : DataMigrationImpl { + public int Create() { + SchemaBuilder.CreateTable("MediaSettingsPartRecord", + table => table + .ContentPartRecord() + .Column("UploadAllowedFileTypeWhitelist", c => c.WithDefault(MediaSettingsPartRecord.DefaultWhitelist).WithLength(255)) + ); + + return 1; + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPart.cs b/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPart.cs new file mode 100644 index 000000000..39228bf9c --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPart.cs @@ -0,0 +1,11 @@ +using Orchard.ContentManagement; +using System; + +namespace Orchard.Media.Models { + public class MediaSettingsPart : ContentPart { + public string UploadAllowedFileTypeWhitelist { + get { return Record.UploadAllowedFileTypeWhitelist; } + set { Record.UploadAllowedFileTypeWhitelist = value; } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs b/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs new file mode 100644 index 000000000..5e35adee4 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs @@ -0,0 +1,15 @@ +using System.Net.Mail; +using Orchard.ContentManagement.Records; +using System.ComponentModel.DataAnnotations; + +namespace Orchard.Media.Models { + public class MediaSettingsPartRecord : ContentPartRecord { + internal const string DefaultWhitelist = "jpg jpeg gif png txt doc docx xls xlsx pdf ppt pptx pps ppsx odt ods odp"; + private string _whitelist = DefaultWhitelist; + + public virtual string UploadAllowedFileTypeWhitelist { + get { return _whitelist; } + set { _whitelist = value; } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj b/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj index 3bebf0e29..d0a712b96 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj +++ b/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj @@ -71,6 +71,10 @@ + + + + @@ -113,6 +117,9 @@ + + + + + + diff --git a/src/Orchard.Web/Core/Contents/Views/Content.PublishButton.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.PublishButton.cshtml new file mode 100644 index 000000000..b8f48a08f --- /dev/null +++ b/src/Orchard.Web/Core/Contents/Views/Content.PublishButton.cshtml @@ -0,0 +1,3 @@ +
      + +
      \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Content.SaveButton.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.SaveButton.cshtml new file mode 100644 index 000000000..cab18005a --- /dev/null +++ b/src/Orchard.Web/Core/Contents/Views/Content.SaveButton.cshtml @@ -0,0 +1,3 @@ +
      + +
      \ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml b/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml index e0f0cd87b..af834ed7e 100644 --- a/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml @@ -4,9 +4,5 @@
      @Display(Model.Sidebar) - @* todo: (heskew) remove when the CommonPart is adding the save button *@ -
      - -
      \ No newline at end of file diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index 54c8e7862..130141afa 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -274,12 +274,8 @@ - - Designer - - - Designer - + + @@ -358,18 +354,16 @@ - - Designer - - - Designer - + + + + Designer diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs b/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs index a8ba7544a..5724829e3 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs @@ -7,7 +7,6 @@ using Orchard.PublishLater.Services; using Orchard.PublishLater.ViewModels; using Orchard.Localization; using System.Globalization; -using Orchard.Core.Localization.Services; namespace Orchard.PublishLater.Drivers { public class PublishLaterPartDriver : ContentPartDriver { @@ -49,8 +48,8 @@ namespace Orchard.PublishLater.Drivers { // date and time are formatted using the same patterns as DateTimePicker is, preventing other cultures issues var model = new PublishLaterViewModel(part) { ScheduledPublishUtc = part.ScheduledPublishUtc.Value, - ScheduledPublishDate = part.ScheduledPublishUtc.Value.HasValue ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(DatePattern, CultureInfo.InvariantCulture) : String.Empty, - ScheduledPublishTime = part.ScheduledPublishUtc.Value.HasValue ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(TimePattern, CultureInfo.InvariantCulture) : String.Empty + ScheduledPublishDate = part.ScheduledPublishUtc.Value.HasValue && !part.IsPublished() ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(DatePattern, CultureInfo.InvariantCulture) : String.Empty, + ScheduledPublishTime = part.ScheduledPublishUtc.Value.HasValue && !part.IsPublished() ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(TimePattern, CultureInfo.InvariantCulture) : String.Empty }; return ContentShape("Parts_PublishLater_Edit", @@ -60,27 +59,24 @@ namespace Orchard.PublishLater.Drivers { var model = new PublishLaterViewModel(part); updater.TryUpdateModel(model, Prefix, null, null); - switch (model.Command) { - case "PublishNow": - _commonService.Publish(model.ContentItem); - break; - case "PublishLater": - DateTime scheduled; - string parseDateTime = String.Concat(model.ScheduledPublishDate, " ", model.ScheduledPublishTime); - - // use an english culture as it is the one used by jQuery.datepicker by default - if (DateTime.TryParse(parseDateTime, CultureInfo.GetCultureInfo("en-US"), DateTimeStyles.AssumeLocal, out scheduled)) { - model.ScheduledPublishUtc = part.ScheduledPublishUtc.Value = scheduled.ToUniversalTime(); - _publishLaterService.Publish(model.ContentItem, model.ScheduledPublishUtc.Value); - } - else { - updater.AddModelError(Prefix, T("{0} is an invalid date and time", parseDateTime)); - } - break; - case "SaveDraft": - break; + if (!string.IsNullOrWhiteSpace(model.ScheduledPublishDate) && !string.IsNullOrWhiteSpace(model.ScheduledPublishTime)) { + DateTime scheduled; + string parseDateTime = String.Concat(model.ScheduledPublishDate, " ", model.ScheduledPublishTime); + + // use an english culture as it is the one used by jQuery.datepicker by default + if (DateTime.TryParse(parseDateTime, CultureInfo.GetCultureInfo("en-US"), DateTimeStyles.AssumeLocal, out scheduled)) { + model.ScheduledPublishUtc = part.ScheduledPublishUtc.Value = scheduled.ToUniversalTime(); + _publishLaterService.Publish(model.ContentItem, model.ScheduledPublishUtc.Value); + } + else { + updater.AddModelError(Prefix, T("{0} is an invalid date and time", parseDateTime)); + } } + else if (!string.IsNullOrWhiteSpace(model.ScheduledPublishDate) || !string.IsNullOrWhiteSpace(model.ScheduledPublishTime)) { + updater.AddModelError(Prefix, T("Both the date and time need to be specified for when this is to be published. If you don't want to schedule publishing then clear both the date and time fields.")); + } + return ContentShape("Parts_PublishLater_Edit", () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); } diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Placement.info b/src/Orchard.Web/Modules/Orchard.PublishLater/Placement.info index f321cd6a5..e1671d67b 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Placement.info +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Placement.info @@ -7,7 +7,7 @@ --> - + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css b/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css index 21684b460..af6b87158 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css @@ -7,8 +7,8 @@ html.dyn input.hinted { font-style:italic; } input#PublishLater_ScheduledPublishDate { - width:50%; + width:49%; } input#PublishLater_ScheduledPublishTime { - width:36%; + width:43%; } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs b/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs index 3961d56c4..4c5392c16 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs @@ -11,7 +11,6 @@ namespace Orchard.PublishLater.ViewModels { _publishLaterPart = publishLaterPart; } - public string Command { get; set; } public ContentItem ContentItem { get { return _publishLaterPart.ContentItem; } } public bool IsPublished { diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml index 5b7681ce3..1ac58b8ee 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml @@ -4,48 +4,36 @@ Script.Require("jQueryUI_DatePicker"); Style.Require("PublishLater_DatePicker"); Style.Require("jQueryUtils_TimePicker"); - Style.Require("jQueryUI_DatePicker"); + Style.Require("jQueryUI_DatePicker"); } -
      +
      @T("Publish Settings") -
      - @Html.RadioButton("Command", "SaveDraft", Model.ContentItem.VersionRecord == null || !Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_SaveDraft") }) - -
      -
      - @Html.RadioButton("Command", "PublishNow", Model.ContentItem.VersionRecord != null && Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishNow") }) - -
      -
      - @Html.RadioButton("Command", "PublishLater", Model.ScheduledPublishUtc != null, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater") }) - -
      -
      - - @Html.EditorFor(m => m.ScheduledPublishDate) - - @Html.EditorFor(m => m.ScheduledPublishTime) -
      + + @Html.EditorFor(m => m.ScheduledPublishDate) + + @Html.EditorFor(m => m.ScheduledPublishTime)
      @using(Script.Foot()) { diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Edit.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Edit.cshtml index 362228de1..d3c8ccb8d 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Edit.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Edit.cshtml @@ -19,6 +19,6 @@ @Display(Model.User)
      - +
      } diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css index 8ae765e65..865e0ee9f 100644 --- a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css +++ b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css @@ -128,13 +128,13 @@ number of columns: 24; actual width: 946; column width: 26; gutter width:14 .sections .primary { display:inline; float:left; - width:74.543%; + width:69.452%; } .sections .secondary { display:inline; float:left; margin-left:1.71%; - width:23.629%; + width:28.721%; } /* Headings and defaults @@ -842,6 +842,29 @@ table .button { .settings legend { margin:0 0 -.4em 0; } +/* Core Contents and Orchard.PublishLater */ +fieldset.save-button { + clear:none; + float:left; + padding-right:0; + width:auto; +} +fieldset.publish-later-datetime { + clear:none; + float:left; + min-width:13.6em; + padding-left:6px; + padding-right:0; + width:68%; +} +fieldset.publish-later-datetime legend { + display:none; +} +fieldset.publish-later-datetime input { + padding:1px; + text-align:center; + color:#666; +} /* Fields ----------------------------------------------------------*/ From 5421028cdd98c44cf22709b0909e160348729dde Mon Sep 17 00:00:00 2001 From: Dave Reed Date: Thu, 4 Nov 2010 14:00:12 -0700 Subject: [PATCH 14/14] Adding str length annotation to model --HG-- branch : dev --- .../Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs b/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs index 5e35adee4..758732576 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs +++ b/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs @@ -7,6 +7,7 @@ namespace Orchard.Media.Models { internal const string DefaultWhitelist = "jpg jpeg gif png txt doc docx xls xlsx pdf ppt pptx pps ppsx odt ods odp"; private string _whitelist = DefaultWhitelist; + [StringLength(255)] public virtual string UploadAllowedFileTypeWhitelist { get { return _whitelist; } set { _whitelist = value; }