diff --git a/build/UmbracoVersion.txt b/build/UmbracoVersion.txt index c12ac783cc..01a820821e 100644 --- a/build/UmbracoVersion.txt +++ b/build/UmbracoVersion.txt @@ -1,2 +1,2 @@ # Usage: on line 2 put the release version, on line 3 put the version comment (example: beta) -7.6.4 \ No newline at end of file +7.6.5 \ No newline at end of file diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index fe3be21eb7..e8a36f0da7 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -11,5 +11,5 @@ using System.Resources; [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyFileVersion("7.6.4")] -[assembly: AssemblyInformationalVersion("7.6.4")] \ No newline at end of file +[assembly: AssemblyFileVersion("7.6.5")] +[assembly: AssemblyInformationalVersion("7.6.5")] \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs index 85b9bf3685..0d093c395e 100644 --- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs +++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs @@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration { public class UmbracoVersion { - private static readonly Version Version = new Version("7.6.4"); + private static readonly Version Version = new Version("7.6.5"); /// /// Gets the current version of Umbraco. diff --git a/src/Umbraco.Core/IO/FileSystemProviderManager.cs b/src/Umbraco.Core/IO/FileSystemProviderManager.cs index df922fb2b0..d2ae8a0612 100644 --- a/src/Umbraco.Core/IO/FileSystemProviderManager.cs +++ b/src/Umbraco.Core/IO/FileSystemProviderManager.cs @@ -19,6 +19,8 @@ namespace Umbraco.Core.IO private ShadowWrapper _macroPartialFileSystem; private ShadowWrapper _partialViewsFileSystem; + private ShadowWrapper _macroScriptsFileSystem; + private ShadowWrapper _userControlsFileSystem; private ShadowWrapper _stylesheetsFileSystem; private ShadowWrapper _scriptsFileSystem; private ShadowWrapper _xsltFileSystem; @@ -61,6 +63,8 @@ namespace Umbraco.Core.IO { var macroPartialFileSystem = new PhysicalFileSystem(SystemDirectories.MacroPartials); var partialViewsFileSystem = new PhysicalFileSystem(SystemDirectories.PartialViews); + var macroScriptsFileSystem = new PhysicalFileSystem(SystemDirectories.MacroScripts); + var userControlsFileSystem = new PhysicalFileSystem(SystemDirectories.UserControls); var stylesheetsFileSystem = new PhysicalFileSystem(SystemDirectories.Css); var scriptsFileSystem = new PhysicalFileSystem(SystemDirectories.Scripts); var xsltFileSystem = new PhysicalFileSystem(SystemDirectories.Xslt); @@ -69,6 +73,8 @@ namespace Umbraco.Core.IO _macroPartialFileSystem = new ShadowWrapper(macroPartialFileSystem, "Views/MacroPartials", ScopeProvider); _partialViewsFileSystem = new ShadowWrapper(partialViewsFileSystem, "Views/Partials", ScopeProvider); + _macroScriptsFileSystem = new ShadowWrapper(macroScriptsFileSystem, "macroScripts", ScopeProvider); + _userControlsFileSystem = new ShadowWrapper(userControlsFileSystem, "usercontrols", ScopeProvider); _stylesheetsFileSystem = new ShadowWrapper(stylesheetsFileSystem, "css", ScopeProvider); _scriptsFileSystem = new ShadowWrapper(scriptsFileSystem, "scripts", ScopeProvider); _xsltFileSystem = new ShadowWrapper(xsltFileSystem, "xslt", ScopeProvider); @@ -85,6 +91,10 @@ namespace Umbraco.Core.IO public IFileSystem2 MacroPartialsFileSystem { get { return _macroPartialFileSystem; } } public IFileSystem2 PartialViewsFileSystem { get { return _partialViewsFileSystem; } } + // Legacy /macroScripts folder + public IFileSystem2 MacroScriptsFileSystem { get { return _macroScriptsFileSystem; } } + // Legacy /usercontrols folder + public IFileSystem2 UserControlsFileSystem { get { return _userControlsFileSystem; } } public IFileSystem2 StylesheetsFileSystem { get { return _stylesheetsFileSystem; } } public IFileSystem2 ScriptsFileSystem { get { return _scriptsFileSystem; } } public IFileSystem2 XsltFileSystem { get { return _xsltFileSystem; } } @@ -252,13 +262,15 @@ namespace Umbraco.Core.IO internal ICompletable Shadow(Guid id) { var typed = _wrappers.ToArray(); - var wrappers = new ShadowWrapper[typed.Length + 7]; + var wrappers = new ShadowWrapper[typed.Length + 9]; var i = 0; while (i < typed.Length) wrappers[i] = typed[i++]; wrappers[i++] = _macroPartialFileSystem; + wrappers[i++] = _macroScriptsFileSystem; wrappers[i++] = _partialViewsFileSystem; wrappers[i++] = _stylesheetsFileSystem; wrappers[i++] = _scriptsFileSystem; + wrappers[i++] = _userControlsFileSystem; wrappers[i++] = _xsltFileSystem; wrappers[i++] = _masterPagesFileSystem; wrappers[i] = _mvcViewsFileSystem; diff --git a/src/Umbraco.Core/Models/IUserControl.cs b/src/Umbraco.Core/Models/IUserControl.cs new file mode 100644 index 0000000000..2660567258 --- /dev/null +++ b/src/Umbraco.Core/Models/IUserControl.cs @@ -0,0 +1,7 @@ +namespace Umbraco.Core.Models +{ + public interface IUserControl : IFile + { + + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Models/PartialViewType.cs b/src/Umbraco.Core/Models/PartialViewType.cs index 6204b6e165..6740d1fdd9 100644 --- a/src/Umbraco.Core/Models/PartialViewType.cs +++ b/src/Umbraco.Core/Models/PartialViewType.cs @@ -4,6 +4,7 @@ { Unknown = 0, // default PartialView = 1, - PartialViewMacro = 2 + PartialViewMacro = 2, + MacroScript = 3 } } diff --git a/src/Umbraco.Core/Models/UserControl.cs b/src/Umbraco.Core/Models/UserControl.cs new file mode 100644 index 0000000000..6af4cd74cc --- /dev/null +++ b/src/Umbraco.Core/Models/UserControl.cs @@ -0,0 +1,32 @@ +using System; +using System.Runtime.Serialization; + +namespace Umbraco.Core.Models +{ + /// + /// Represents a UserControl file + /// + [Serializable] + [DataContract(IsReference = true)] + public class UserControl : File, IUserControl + { + public UserControl(string path) + : this(path, (Func)null) + { } + + internal UserControl(string path, Func getFileContent) + : base(path, getFileContent) + { } + + /// + /// Indicates whether the current entity has an identity, which in this case is a path/name. + /// + /// + /// Overrides the default Entity identity check. + /// + public override bool HasIdentity + { + get { return string.IsNullOrEmpty(Path) == false; } + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/UpdateUniqueIdToHaveCorrectIndexType.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/UpdateUniqueIdToHaveCorrectIndexType.cs index 79d7b3111c..dc8415a9f8 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/UpdateUniqueIdToHaveCorrectIndexType.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenThreeZero/UpdateUniqueIdToHaveCorrectIndexType.cs @@ -1,5 +1,4 @@ using System.Linq; -using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Persistence.DatabaseModelDefinitions; using Umbraco.Core.Persistence.SqlSyntax; @@ -11,15 +10,11 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe { public UpdateUniqueIdToHaveCorrectIndexType(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger) - { - } + { } - //see: http://issues.umbraco.org/issue/U4-6188, http://issues.umbraco.org/issue/U4-6187 public override void Up() { - - - var dbIndexes = SqlSyntax.GetDefinedIndexes(Context.Database) + var indexes = SqlSyntax.GetDefinedIndexes(Context.Database) .Select(x => new DbIndexDefinition() { TableName = x.Item1, @@ -28,24 +23,19 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeZe IsUnique = x.Item4 }).ToArray(); - //must be non-nullable + // drop the index if it exists + if (indexes.Any(x => x.IndexName.InvariantEquals("IX_umbracoNodeUniqueID"))) + Delete.Index("IX_umbracoNodeUniqueID").OnTable("umbracoNode"); + + // set uniqueID to be non-nullable + // the index *must* be dropped else 'one or more objects access this column' exception Alter.Table("umbracoNode").AlterColumn("uniqueID").AsGuid().NotNullable(); - //make sure it already exists - if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_umbracoNodeUniqueID"))) - { - Delete.Index("IX_umbracoNodeUniqueID").OnTable("umbracoNode"); - } - //make sure it doesn't already exist - if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_umbracoNode_uniqueID")) == false) - { - //must be a uniqe index - Create.Index("IX_umbracoNode_uniqueID").OnTable("umbracoNode").OnColumn("uniqueID").Unique(); - } + // create the index + Create.Index("IX_umbracoNode_uniqueID").OnTable("umbracoNode").OnColumn("uniqueID").Unique(); } public override void Down() - { - } + { } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserControlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserControlRepository.cs new file mode 100644 index 0000000000..7efb29b0a5 --- /dev/null +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IUserControlRepository.cs @@ -0,0 +1,13 @@ +using System.IO; +using Umbraco.Core.Models; + +namespace Umbraco.Core.Persistence.Repositories +{ + public interface IUserControlRepository : IRepository + { + bool ValidateUserControl(UserControl userControl); + Stream GetFileContentStream(string filepath); + void SetFileContent(string filepath, Stream content); + long GetFileSize(string filepath); + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Repositories/MacroScriptRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MacroScriptRepository.cs new file mode 100644 index 0000000000..0f335173ad --- /dev/null +++ b/src/Umbraco.Core/Persistence/Repositories/MacroScriptRepository.cs @@ -0,0 +1,15 @@ +using Umbraco.Core.IO; +using Umbraco.Core.Models; +using Umbraco.Core.Persistence.UnitOfWork; + +namespace Umbraco.Core.Persistence.Repositories +{ + internal class MacroScriptRepository : PartialViewRepository + { + public MacroScriptRepository(IUnitOfWork work, IFileSystem fileSystem) + : base(work, fileSystem) + { } + + protected override PartialViewType ViewType { get { return PartialViewType.MacroScript; } } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Repositories/UserControlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/UserControlRepository.cs new file mode 100644 index 0000000000..77ad09cb57 --- /dev/null +++ b/src/Umbraco.Core/Persistence/Repositories/UserControlRepository.cs @@ -0,0 +1,135 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Umbraco.Core.IO; +using Umbraco.Core.Models; +using Umbraco.Core.Persistence.UnitOfWork; + +namespace Umbraco.Core.Persistence.Repositories +{ + /// + /// Represents the UserControl Repository + /// + internal class UserControlRepository : FileRepository, IUserControlRepository + { + public UserControlRepository(IUnitOfWork work, IFileSystem fileSystem) + : base(work, fileSystem) + { + } + + public override UserControl Get(string id) + { + var path = FileSystem.GetRelativePath(id); + + path = path.EnsureEndsWith(".ascx"); + + if (FileSystem.FileExists(path) == false) + return null; + + var created = FileSystem.GetCreated(path).UtcDateTime; + var updated = FileSystem.GetLastModified(path).UtcDateTime; + + var userControl = new UserControl(path, file => GetFileContent(file.OriginalPath)) + { + Key = path.EncodeAsGuid(), + CreateDate = created, + UpdateDate = updated, + Id = path.GetHashCode(), + VirtualPath = FileSystem.GetUrl(path) + }; + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + userControl.ResetDirtyProperties(false); + + return userControl; + } + + public override void AddOrUpdate(UserControl entity) + { + base.AddOrUpdate(entity); + + // ensure that from now on, content is lazy-loaded + if (entity.GetFileContent == null) + entity.GetFileContent = file => GetFileContent(file.OriginalPath); + } + + public override IEnumerable GetAll(params string[] ids) + { + ids = ids + .Select(x => StringExtensions.EnsureEndsWith(x, ".ascx")) + .Distinct() + .ToArray(); + + if (ids.Any()) + { + foreach (var id in ids) + { + yield return Get(id); + } + } + else + { + var files = FindAllFiles("", "*.ascx"); + foreach (var file in files) + { + yield return Get(file); + } + } + } + + /// + /// Gets a list of all that exist at the relative path specified. + /// + /// + /// If null or not specified, will return the UserControl files at the root path relative to the IFileSystem + /// + /// + public IEnumerable GetUserControlsAtPath(string rootPath = null) + { + return FileSystem.GetFiles(rootPath ?? string.Empty, "*.ascx").Select(Get); + } + + private static readonly List ValidExtensions = new List { "ascx" }; + + public bool ValidateUserControl(UserControl userControl) + { + // get full path + string fullPath; + try + { + // may throw for security reasons + fullPath = FileSystem.GetFullPath(userControl.Path); + } + catch + { + return false; + } + + // validate path and extension + var validDir = SystemDirectories.UserControls; + var isValidPath = IOHelper.VerifyEditPath(fullPath, validDir); + var isValidExtension = IOHelper.VerifyFileExtension(userControl.Path, ValidExtensions); + return isValidPath && isValidExtension; + } + + public Stream GetFileContentStream(string filepath) + { + if (FileSystem.FileExists(filepath) == false) return null; + + try + { + return FileSystem.OpenFile(filepath); + } + catch + { + return null; // deal with race conds + } + } + + public void SetFileContent(string filepath, Stream content) + { + FileSystem.AddFile(filepath, content, true); + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/RepositoryFactory.cs b/src/Umbraco.Core/Persistence/RepositoryFactory.cs index afb93f620f..631c292eac 100644 --- a/src/Umbraco.Core/Persistence/RepositoryFactory.cs +++ b/src/Umbraco.Core/Persistence/RepositoryFactory.cs @@ -231,6 +231,18 @@ namespace Umbraco.Core.Persistence return new PartialViewMacroRepository(uow, FileSystemProviderManager.Current.MacroPartialsFileSystem); } + [Obsolete("MacroScripts are obsolete - this is for backwards compatibility with upgraded sites.")] + internal virtual IPartialViewRepository CreateMacroScriptRepository(IUnitOfWork uow) + { + return new MacroScriptRepository(uow, FileSystemProviderManager.Current.MacroScriptsFileSystem); + } + + [Obsolete("UserControls are obsolete - this is for backwards compatibility with upgraded sites.")] + internal virtual IUserControlRepository CreateUserControlRepository(IUnitOfWork uow) + { + return new UserControlRepository(uow, FileSystemProviderManager.Current.UserControlsFileSystem); + } + public virtual IStylesheetRepository CreateStylesheetRepository(IUnitOfWork uow) { return new StylesheetRepository(uow, FileSystemProviderManager.Current.StylesheetsFileSystem); diff --git a/src/Umbraco.Core/Services/FileService.cs b/src/Umbraco.Core/Services/FileService.cs index 28fb07fe9e..4833401df8 100644 --- a/src/Umbraco.Core/Services/FileService.cs +++ b/src/Umbraco.Core/Services/FileService.cs @@ -621,6 +621,34 @@ namespace Umbraco.Core.Services } } + public Stream GetMacroScriptFileContentStream(string filepath) + { + using (var uow = UowProvider.GetUnitOfWork(readOnly: true)) + { + var repository = RepositoryFactory.CreateMacroScriptRepository(uow); + return repository.GetFileContentStream(filepath); + } + } + + public void SetMacroScriptFileContent(string filepath, Stream content) + { + using (var uow = UowProvider.GetUnitOfWork()) + { + var repository = RepositoryFactory.CreateMacroScriptRepository(uow); + repository.SetFileContent(filepath, content); + uow.Commit(); + } + } + + public long GetMacroScriptFileSize(string filepath) + { + using (var uow = UowProvider.GetUnitOfWork(readOnly: true)) + { + var repository = RepositoryFactory.CreateMacroScriptRepository(uow); + return repository.GetFileSize(filepath); + } + } + #endregion public Stream GetStylesheetFileContentStream(string filepath) @@ -679,6 +707,34 @@ namespace Umbraco.Core.Services } } + public Stream GetUserControlFileContentStream(string filepath) + { + using (var uow = UowProvider.GetUnitOfWork(readOnly: true)) + { + var repository = RepositoryFactory.CreateUserControlRepository(uow); + return repository.GetFileContentStream(filepath); + } + } + + public void SetUserControlFileContent(string filepath, Stream content) + { + using (var uow = UowProvider.GetUnitOfWork()) + { + var repository = RepositoryFactory.CreateUserControlRepository(uow); + repository.SetFileContent(filepath, content); + uow.Commit(); + } + } + + public long GetUserControlFileSize(string filepath) + { + using (var uow = UowProvider.GetUnitOfWork(readOnly: true)) + { + var repository = RepositoryFactory.CreateUserControlRepository(uow); + return repository.GetFileSize(filepath); + } + } + public Stream GetXsltFileContentStream(string filepath) { using (var uow = UowProvider.GetUnitOfWork(readOnly: true)) @@ -783,6 +839,26 @@ namespace Umbraco.Core.Services } } + [Obsolete("MacroScripts are obsolete - this is for backwards compatibility with upgraded sites.")] + public IPartialView GetMacroScript(string path) + { + using (var uow = UowProvider.GetUnitOfWork(readOnly: true)) + { + var repository = RepositoryFactory.CreateMacroScriptRepository(uow); + return repository.Get(path); + } + } + + [Obsolete("UserControls are obsolete - this is for backwards compatibility with upgraded sites.")] + public IUserControl GetUserControl(string path) + { + using (var uow = UowProvider.GetUnitOfWork(readOnly: true)) + { + var repository = RepositoryFactory.CreateUserControlRepository(uow); + return repository.Get(path); + } + } + public IEnumerable GetPartialViewMacros(params string[] names) { using (var uow = UowProvider.GetUnitOfWork(readOnly: true)) diff --git a/src/Umbraco.Core/Services/IFileService.cs b/src/Umbraco.Core/Services/IFileService.cs index e8f1065219..74de0861d8 100644 --- a/src/Umbraco.Core/Services/IFileService.cs +++ b/src/Umbraco.Core/Services/IFileService.cs @@ -17,6 +17,10 @@ namespace Umbraco.Core.Services void DeletePartialViewMacroFolder(string folderPath); IPartialView GetPartialView(string path); IPartialView GetPartialViewMacro(string path); + [Obsolete("MacroScripts are obsolete - this is for backwards compatibility with upgraded sites.")] + IPartialView GetMacroScript(string path); + [Obsolete("UserControls are obsolete - this is for backwards compatibility with upgraded sites.")] + IUserControl GetUserControl(string path); IEnumerable GetPartialViewMacros(params string[] names); IXsltFile GetXsltFile(string path); IEnumerable GetXsltFiles(params string[] names); @@ -263,6 +267,27 @@ namespace Umbraco.Core.Services /// The size of the template. long GetTemplateFileSize(string filepath); + /// + /// Gets the content of a macroscript as a stream. + /// + /// The filesystem path to the macroscript. + /// The content of the macroscript. + Stream GetMacroScriptFileContentStream(string filepath); + + /// + /// Sets the content of a macroscript. + /// + /// The filesystem path to the macroscript. + /// The content of the macroscript. + void SetMacroScriptFileContent(string filepath, Stream content); + + /// + /// Gets the size of a macroscript. + /// + /// The filesystem path to the macroscript. + /// The size of the macroscript. + long GetMacroScriptFileSize(string filepath); + /// /// Gets the content of a stylesheet as a stream. /// @@ -305,6 +330,27 @@ namespace Umbraco.Core.Services /// The size of the script file. long GetScriptFileSize(string filepath); + /// + /// Gets the content of a usercontrol as a stream. + /// + /// The filesystem path to the usercontrol. + /// The content of the usercontrol. + Stream GetUserControlFileContentStream(string filepath); + + /// + /// Sets the content of a usercontrol. + /// + /// The filesystem path to the usercontrol. + /// The content of the usercontrol. + void SetUserControlFileContent(string filepath, Stream content); + + /// + /// Gets the size of a usercontrol. + /// + /// The filesystem path to the usercontrol. + /// The size of the usercontrol. + long GetUserControlFileSize(string filepath); + /// /// Gets the content of a XSLT file as a stream. /// diff --git a/src/Umbraco.Core/UdiEntityType.cs b/src/Umbraco.Core/UdiEntityType.cs index 0119e83b24..8fb5d99338 100644 --- a/src/Umbraco.Core/UdiEntityType.cs +++ b/src/Umbraco.Core/UdiEntityType.cs @@ -69,6 +69,10 @@ namespace Umbraco.Core [UdiType(UdiType.StringUdi)] public const string AnyString = "any-string"; // that one is for tests + [UdiType(UdiType.StringUdi)] + public const string Language = "language"; + [UdiType(UdiType.StringUdi)] + public const string MacroScript = "macroscript"; [UdiType(UdiType.StringUdi)] public const string MediaFile = "media-file"; [UdiType(UdiType.StringUdi)] @@ -82,9 +86,9 @@ namespace Umbraco.Core [UdiType(UdiType.StringUdi)] public const string PartialViewMacro = "partial-view-macro"; [UdiType(UdiType.StringUdi)] - public const string Xslt = "xslt"; + public const string UserControl = "usercontrol"; [UdiType(UdiType.StringUdi)] - public const string Language = "language"; + public const string Xslt = "xslt"; public static string FromUmbracoObjectType(UmbracoObjectTypes umbracoObjectType) { diff --git a/src/Umbraco.Core/UdiGetterExtensions.cs b/src/Umbraco.Core/UdiGetterExtensions.cs index d663acba9d..4ae6b05dca 100644 --- a/src/Umbraco.Core/UdiGetterExtensions.cs +++ b/src/Umbraco.Core/UdiGetterExtensions.cs @@ -190,6 +190,17 @@ namespace Umbraco.Core return new GuidUdi(Constants.UdiEntityType.Macro, entity.Key).EnsureClosed(); } + /// + /// Gets the entity identifier of the entity. + /// + /// The entity. + /// The entity identifier of the entity. + public static StringUdi GetUdi(this IUserControl entity) + { + if (entity == null) throw new ArgumentNullException("entity"); + return new StringUdi(Constants.UdiEntityType.UserControl, entity.Path.TrimStart('/')).EnsureClosed(); + } + /// /// Gets the entity identifier of the entity. /// diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index d5a9ea33cc..24fdf32150 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -344,7 +344,9 @@ + + @@ -576,12 +578,15 @@ + + + diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/database.controller.js b/src/Umbraco.Web.UI.Client/src/installer/steps/database.controller.js index 5b3e174930..c4ac65bff1 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/database.controller.js +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/database.controller.js @@ -1,28 +1,35 @@ angular.module("umbraco.install").controller("Umbraco.Installer.DataBaseController", function($scope, $http, installerService){ $scope.checking = false; + $scope.invalidDbDns = false; + $scope.dbs = [ - {name: 'Microsoft SQL Server Compact (SQL CE)', id: 0}, - {name: 'Microsoft SQL Server', id: 1}, - { name: 'Microsoft SQL Azure', id: 3 }, - { name: 'MySQL', id: 2 }, - {name: 'Custom connection string', id: -1}]; + { name: 'Microsoft SQL Server Compact (SQL CE)', id: 0}, + { name: 'Microsoft SQL Server', id: 1}, + { name: 'Microsoft SQL Azure', id: 3 }, + { name: 'MySQL', id: 2 }, + { name: 'Custom connection string', id: -1} + ]; - if(installerService.status.current.model.dbType === undefined){ + if ( installerService.status.current.model.dbType === undefined ) { installerService.status.current.model.dbType = 0; } - $scope.validateAndForward = function(){ - if(!$scope.checking && this.myForm.$valid){ + $scope.validateAndForward = function(){ + if ( !$scope.checking && this.myForm.$valid ) { $scope.checking = true; + $scope.invalidDbDns = false; + var model = installerService.status.current.model; - $http.post(Umbraco.Sys.ServerVariables.installApiBaseUrl + "PostValidateDatabaseConnection", - model).then(function(response){ + $http.post( + Umbraco.Sys.ServerVariables.installApiBaseUrl + "PostValidateDatabaseConnection", + model ).then( function( response ) { - if(response.data === "true"){ + if ( response.data === "true" ) { installerService.forward(); - }else{ + } + else { $scope.invalidDbDns = true; } @@ -33,4 +40,4 @@ angular.module("umbraco.install").controller("Umbraco.Installer.DataBaseControll }); } }; -}); \ No newline at end of file +}); diff --git a/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.html b/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.html index 6ccf99be7f..0b9e22a0f3 100644 --- a/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.html +++ b/src/Umbraco.Web.UI.Client/src/installer/steps/starterkit.html @@ -1,16 +1,23 @@
-

Would you like to learn or demo Umbraco?

+

Install a starter website

+ +

+ Installing a starter website helps you learn how Umbraco works, and gives you a solid + and simple foundation to build on top of. +

+ + Loading... + + - {{pck.name}} -

The Starter Kit is a great way to experience some of the ways you can use Umbraco. It's a complete website with textpages, landing pages, blog, product listings and more that's easy to get started with Umbraco. -

-

- It's also a great way to learn Umbraco as the Starter Kit comes with a set of Lessons that'll teach you how to implement and extend Umbraco using short 5-15 minute tasks. -

-

- Yes, I'd like a Starter Kit -   - No thanks + No thanks, I do not want to install a starter website -

\ No newline at end of file + diff --git a/src/Umbraco.Web.UI.Client/src/less/forms.less b/src/Umbraco.Web.UI.Client/src/less/forms.less index 869d0b7740..480b96b804 100644 --- a/src/Umbraco.Web.UI.Client/src/less/forms.less +++ b/src/Umbraco.Web.UI.Client/src/less/forms.less @@ -66,8 +66,9 @@ label.control-label, .control-label { } .form-search .icon, .form-search .icon-search { position: absolute; + z-index: 1; top: 6px; - left: 4px; + left: 6px; color: @gray-8; } @@ -86,6 +87,9 @@ label.control-label, .control-label { background: @white } +.form-search .icon-search + .search-input { + padding-left: 25px !important; +} .form-search .search-input { font-weight: bold; @@ -191,7 +195,7 @@ input[type="tel"], input[type="color"], .uneditable-input { display: inline-block; - height: 30px; + height: @inputHeight; padding: 4px 6px; margin-bottom: @baseLineHeight / 2; font-size: @baseFontSize; @@ -206,7 +210,6 @@ input.-full-width-input { width: 100%; box-sizing: border-box; padding: 4px 6px; - height: 30px; } // Reset appearance properties for textual inputs and textarea @@ -579,9 +582,9 @@ input[type="checkbox"][readonly] { .add-on { display: inline-block; width: auto; - height: @baseLineHeight; - min-width: 16px; - padding: 4px 5px; + height: 22px; + min-width: 18px; + padding: 4px 6px; font-size: @baseFontSize; font-weight: normal; line-height: @baseLineHeight; @@ -653,29 +656,21 @@ input.search-query { padding-left: 14px; padding-left: 4px \9; /* IE7-8 doesn't have border-radius, so don't indent the padding */ margin: 0; // Remove the default margin on all inputs - .border-radius(0px); } /* Allow for input prepend/append in search forms */ -.form-search .input-append .search-query, -.form-search .input-prepend .search-query { - .border-radius(0); // Override due to specificity +.form-search { + .input-prepend { + .btn { + .border-radius(0 @borderRadiusSmall @borderRadiusSmall 0); + } + } + .input-append { + .btn { + .border-radius(0 @borderRadiusSmall @borderRadiusSmall 0); + } + } } -.form-search .input-append .search-query { - .border-radius(14px 0 0 14px); -} -.form-search .input-append .btn { - .border-radius(0 14px 14px 0); -} -.form-search .input-prepend .search-query { - .border-radius(0 14px 14px 0); -} -.form-search .input-prepend .btn { - .border-radius(14px 0 0 14px); -} - - - // HORIZONTAL & VERTICAL FORMS // --------------------------- diff --git a/src/Umbraco.Web.UI.Client/src/less/main.less b/src/Umbraco.Web.UI.Client/src/less/main.less index 1b573bbe0b..222fa2474e 100644 --- a/src/Umbraco.Web.UI.Client/src/less/main.less +++ b/src/Umbraco.Web.UI.Client/src/less/main.less @@ -47,10 +47,25 @@ h5.-black { background: none; border: none } -.datepicker td.active, -.datepicker td span.active { - background: @turquoise !important; +.bootstrap-datetimepicker-widget { + td { + &.active, span.active { + background: @turquoise !important; + } + &.today:not(.active):before { + border-bottom-color: @purple-l1 !important; + } + a[data-action] { + padding: 0 !important; + } + .timepicker-hour, + .timepicker-minute, + .timepicker-second { + margin: 8px 0; + } + } } + .umb-datetime-picker div.info { vertical-align: middle } diff --git a/src/Umbraco.Web.UI.Client/src/less/panel.less b/src/Umbraco.Web.UI.Client/src/less/panel.less index 6bc2a2b2de..7c18b79c81 100644 --- a/src/Umbraco.Web.UI.Client/src/less/panel.less +++ b/src/Umbraco.Web.UI.Client/src/less/panel.less @@ -446,8 +446,8 @@ input.umb-panel-header-name-input { margin-bottom: 0; font-weight: bold; box-sizing: border-box; - height: 30px; - line-height: 30px; + height: 32px; + line-height: 32px; width: 100%; &:hover { background: @white; diff --git a/src/Umbraco.Web.UI.Client/src/less/variables.less b/src/Umbraco.Web.UI.Client/src/less/variables.less index c173f122cb..666941b914 100644 --- a/src/Umbraco.Web.UI.Client/src/less/variables.less +++ b/src/Umbraco.Web.UI.Client/src/less/variables.less @@ -190,7 +190,7 @@ @inputBorderRadius: 0; @inputDisabledBackground: @gray-10; @formActionsBackground: @gray-9; -@inputHeight: @baseLineHeight + 10px; // base line-height + 8px vertical padding + 2px top/bottom border +@inputHeight: @baseLineHeight + 12px; // base line-height + 8px vertical padding + 2px top/bottom border @controlRequiredColor: @red; diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html index 9acb92401b..7bf24c086f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html @@ -2,13 +2,13 @@
[Tree(Constants.Applications.Settings, "partialViews", null, sortOrder: 2)] - public class PartialViewsTreeController : FileSystemTreeController + public class PartialViewsTreeController : FileSystemTreeController2 { - protected override IFileSystem2 FileSystem - { - get { return FileSystemProviderManager.Current.PartialViewsFileSystem; } - } + protected override IFileSystem2 FileSystem + { + get { return FileSystemProviderManager.Current.PartialViewsFileSystem; } + } - private static readonly string[] ExtensionsStatic = { "cshtml" }; + private static readonly string[] ExtensionsStatic = {"cshtml"}; protected override string[] Extensions { diff --git a/src/Umbraco.Web/Trees/ScriptTreeController.cs b/src/Umbraco.Web/Trees/ScriptTreeController.cs index 2e4c25c656..cb9954019b 100644 --- a/src/Umbraco.Web/Trees/ScriptTreeController.cs +++ b/src/Umbraco.Web/Trees/ScriptTreeController.cs @@ -5,7 +5,7 @@ using Umbraco.Web.Models.Trees; namespace Umbraco.Web.Trees { [Tree(Constants.Applications.Settings, "scripts", null, sortOrder: 4)] - public class ScriptTreeController : FileSystemTreeController + public class ScriptTreeController : FileSystemTreeController2 { protected override IFileSystem2 FileSystem { diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 9aaab32af9..44b3258c84 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -435,6 +435,7 @@ + @@ -712,7 +713,7 @@ - + diff --git a/src/Umbraco.Web/umbraco.presentation/macro.cs b/src/Umbraco.Web/umbraco.presentation/macro.cs index 6d2936cd9a..dac3c0e1bf 100644 --- a/src/Umbraco.Web/umbraco.presentation/macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/macro.cs @@ -46,6 +46,7 @@ using System.Linq; using File = System.IO.File; using MacroTypes = umbraco.cms.businesslogic.macro.MacroTypes; using Member = umbraco.cms.businesslogic.member.Member; +using UserControl = System.Web.UI.UserControl; namespace umbraco { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs index d186d9ef50..273318cbff 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/assemblyBrowser.aspx.cs @@ -19,6 +19,7 @@ using Umbraco.Core.PropertyEditors; using umbraco.BusinessLogic; using System.Collections.Generic; using MacroProperty = umbraco.cms.businesslogic.macro.MacroProperty; +using UserControl = System.Web.UI.UserControl; namespace umbraco.developer {