From 2dc6e395a83b9b5d87d5a50092a8dfc2f525c5a1 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Mon, 16 Nov 2015 01:15:51 +0100 Subject: [PATCH 01/24] Add more colors to icon-picker dialog --- .../src/less/property-editors.less | 16 ++- .../src/less/variables.less | 25 +++- .../common/dialogs/iconpicker.controller.js | 6 +- .../src/views/common/dialogs/iconpicker.html | 119 ++++++++++-------- 4 files changed, 110 insertions(+), 56 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index be6b1d7b06..0ca44293f0 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -149,10 +149,22 @@ ul.color-picker li a { -.umb-thumbnails{ - position: relative; +.umb-thumbnails { + position: relative; + display: flex; + -ms-flex-direction: row; + -webkit-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: wrap; + -webkit-flex-wrap: wrap; + flex-wrap: wrap; + justify-content: flex-start; } +.umb-thumbnails > li.icon { + width: 14%; + text-align: center; +} .umb-thumbnails i{margin: auto;} .umb-thumbnails a{ diff --git a/src/Umbraco.Web.UI.Client/src/less/variables.less b/src/Umbraco.Web.UI.Client/src/less/variables.less index ec73e62c0c..55f01ebbfe 100644 --- a/src/Umbraco.Web.UI.Client/src/less/variables.less +++ b/src/Umbraco.Web.UI.Client/src/less/variables.less @@ -38,11 +38,32 @@ //icon colors for tree icons -.color-red, .color-red i{color: #d90416 !important;} +/*.color-red, .color-red i{color: #d90416 !important;} .color-blue, .color-blue i{color: #04bfbf !important;} .color-orange, .color-orange i{color: #d9631e !important;} .color-green, .color-green i{color: #04BF67 !important;} -.color-yellow, .color-yellow i{color: #f28729 !important;} +.color-yellow, .color-yellow i{color: #f28729 !important;}*/ + +/* Colors based on http://zavoloklom.github.io/material-design-color-palette/colors.html */ +.color-black, .color-black i { color: #000 !important; } +.color-blue-grey, .color-blue-grey i { color: #607d8b !important; } +.color-grey, .color-grey i { color: #9e9e9e !important; } +.color-brown, .color-brown i { color: #795548 !important; } +.color-blue, .color-blue i { color: #2196f3 !important; } +.color-light-blue, .color-light-blue i {color: #03a9f4 !important; } +.color-cyan, .color-cyan i { color: #00bcd4 !important; } +.color-green, .color-green i { color: #4caf50 !important; } +.color-light-green, .color-light-green i {color: #8bc34a !important; } +.color-lime, .color-lime i { color: #cddc39 !important; } +.color-yellow, .color-yellow i { color: #ffeb3b !important; } +.color-amber, .color-amber i { color: #ffc107 !important; } +.color-orange, .color-orange i { color: #ff9800 !important; } +.color-deep-orange, .color-deep-orange i { color: #ff5722 !important; } +.color-red, .color-red i { color: #f44336 !important; } +.color-pink, .color-pink i { color: #e91e63 !important; } +.color-purple,.color-purple i { color: #9c27b0 !important; } +.color-deep-purple, .color-deep-purple i { color: #673ab7 !important; } +.color-indigo, .color-indigo i { color: #3f51b5 !important; } // Scaffolding diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js index de71977ebe..7f7eed8e4c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js @@ -8,10 +8,10 @@ angular.module("umbraco") }); $scope.submitClass = function(icon){ - if($scope.color) - { + if($scope.color) { $scope.submit(icon + " " + $scope.color); - }else{ + } + else { $scope.submit(icon); } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html index bcf7fe3247..991165c5fa 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html @@ -1,63 +1,84 @@
-
-
- +
+ + - - +
+ +
From f1d37a5072f19185c19cdb647859381465d1d7f0 Mon Sep 17 00:00:00 2001 From: Kamil Jakubczak Date: Thu, 9 Jun 2016 15:01:26 +0200 Subject: [PATCH 02/24] removes a overflow: hidden which decrease update-tree-layer performance removes a overflow: hidden which decrease update-tree-layer performance. If it is required it should be solved differently due to the possibility of having plenty items in div that has this class. --- src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less index 4b63bfb1a7..8e29cd0e61 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-grid.less @@ -286,7 +286,6 @@ .umb-grid .umb-control { position: relative; display: block; - overflow: hidden; margin-left: 10px; margin-right: 10px; margin-bottom: 10px; From 3f1f67e3230d8a5606dac13a1831e74e7fc61935 Mon Sep 17 00:00:00 2001 From: Neil Gaietto Date: Tue, 16 Aug 2016 09:30:05 -0400 Subject: [PATCH 03/24] U4-8822- Fixes Unpublish error with empty RTE by passing an empty value instead of null --- .../src/views/propertyeditors/rte/rte.controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index bbb8024a53..ac5f6cf4fa 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -322,7 +322,8 @@ angular.module("umbraco") //this is instead of doing a watch on the model.value = faster $scope.model.onValueChanged = function (newVal, oldVal) { //update the display val again if it has changed from the server; - tinyMceEditor.setContent(newVal, { format: 'raw' }); + //uses an empty string in the editor when the value is null + tinyMceEditor.setContent(newVal || "", { format: 'raw' }); //we need to manually fire this event since it is only ever fired based on loading from the DOM, this // is required for our plugins listening to this event to execute tinyMceEditor.fire('LoadContent', null); From 732d3ef326d3bf9d0cfcacb17142358883643d53 Mon Sep 17 00:00:00 2001 From: Barry Date: Sun, 25 Feb 2018 03:18:00 +0000 Subject: [PATCH 04/24] Prevent "unsaved" warning when no changes on MarkDown Editor http://issues.umbraco.org/issue/U4-7484# --- .../markdowneditor/markdowneditor.controller.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js index 53424a7d6e..7a3abdd0e6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/markdowneditor/markdowneditor.controller.js @@ -46,6 +46,7 @@ function MarkdownEditorController($scope, $element, assetsService, dialogService // init the md editor after this digest because the DOM needs to be ready first // so run the init on a timeout $timeout(function () { + $scope.markdownEditorInitComplete = false; var converter2 = new Markdown.Converter(); var editor2 = new Markdown.Editor(converter2, "-" + $scope.model.alias); editor2.run(); @@ -59,7 +60,12 @@ function MarkdownEditorController($scope, $element, assetsService, dialogService editor2.hooks.set("onPreviewRefresh", function () { // We must manually update the model as there is no way to hook into the markdown editor events without exstensive edits to the library. if ($scope.model.value !== $("textarea", $element).val()) { - angularHelper.getCurrentForm($scope).$setDirty(); + if ($scope.markdownEditorInitComplete) { + //only set dirty after init load to avoid "unsaved" dialogue when we don't want it + angularHelper.getCurrentForm($scope).$setDirty(); + } else { + $scope.markdownEditorInitComplete = true; + } $scope.model.value = $("textarea", $element).val(); } }); From 728bf8b52d226cab2f35b1610d34a93b589f09dd Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 7 Mar 2018 14:03:35 +0100 Subject: [PATCH 05/24] Adding disableFeatures server variable and new DisableTemplate property in DisabledFeatures.cs --- .../Editors/BackOfficeServerVariables.cs | 21 ++++++++++++++----- src/Umbraco.Web/Features/DisabledFeatures.cs | 2 ++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs index d401c1c266..8ba22b8d52 100644 --- a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs +++ b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs @@ -13,6 +13,7 @@ using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.Configuration.UmbracoSettings; using Umbraco.Core.IO; +using Umbraco.Web.Features; using Umbraco.Web.HealthCheck; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; @@ -31,6 +32,7 @@ namespace Umbraco.Web.Editors private readonly ApplicationContext _applicationContext; private readonly HttpContextBase _httpContext; private readonly IOwinContext _owinContext; + private readonly DisabledFeatures _disabledFeatures; public BackOfficeServerVariables(UrlHelper urlHelper, ApplicationContext applicationContext, IUmbracoSettingsSection umbracoSettings) { @@ -52,7 +54,8 @@ namespace Umbraco.Web.Editors {"umbracoUrls", new[] {"authenticationApiBaseUrl", "serverVarsJs", "externalLoginsUrl", "currentUserApiBaseUrl"}}, {"umbracoSettings", new[] {"allowPasswordReset", "imageFileTypes", "maxFileSize", "loginBackgroundImage"}}, {"application", new[] {"applicationPath", "cacheBuster"}}, - {"isDebuggingEnabled", new string[] { }} + {"isDebuggingEnabled", new string[] { }}, + {"disabledFeatures", new [] {"disableTemplate"}} }; //now do the filtering... var defaults = GetServerVariables(); @@ -81,7 +84,7 @@ namespace Umbraco.Web.Editors //TODO: This is ultra confusing! this same key is used for different things, when returning the full app when authenticated it is this URL but when not auth'd it's actually the ServerVariables address // so based on compat and how things are currently working we need to replace the serverVarsJs one - ((Dictionary) defaults["umbracoUrls"])["serverVarsJs"] = _urlHelper.Action("ServerVariables", "BackOffice"); + ((Dictionary)defaults["umbracoUrls"])["serverVarsJs"] = _urlHelper.Action("ServerVariables", "BackOffice"); return defaults; } @@ -328,6 +331,14 @@ namespace Umbraco.Web.Editors .ToArray() } } + }, + { + "disabledFeatures", new Dictionary + { + { + "disableTemplate", FeaturesResolver.Current.Features.Disabled.DisableTemplate + } + } } }; return defaultVals; @@ -352,9 +363,9 @@ namespace Umbraco.Web.Editors .ToArray(); return (from p in pluginTreesWithAttributes - let treeAttr = p.attributes.OfType().Single() - let pluginAttr = p.attributes.OfType().Single() - select new Dictionary + let treeAttr = p.attributes.OfType().Single() + let pluginAttr = p.attributes.OfType().Single() + select new Dictionary { {"alias", treeAttr.Alias}, {"packageFolder", pluginAttr.AreaName} }).ToArray(); diff --git a/src/Umbraco.Web/Features/DisabledFeatures.cs b/src/Umbraco.Web/Features/DisabledFeatures.cs index b9d8d0a2d9..75eface65d 100644 --- a/src/Umbraco.Web/Features/DisabledFeatures.cs +++ b/src/Umbraco.Web/Features/DisabledFeatures.cs @@ -20,5 +20,7 @@ namespace Umbraco.Web.Features /// Gets the disabled controllers. /// public TypeList Controllers { get; private set; } + + public bool DisableTemplate { get; set; } } } From eb06e62937c146f60d956cc847200bed5cfc59ec Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 7 Mar 2018 14:10:25 +0100 Subject: [PATCH 06/24] Removing the option to create document type with a template --- .../views/documenttypes/create.controller.js | 30 +++++++++++-------- .../src/views/documenttypes/create.html | 16 ++++++---- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js index 4e734b76a6..b800510e69 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.controller.js @@ -14,18 +14,21 @@ function DocumentTypesCreateController($scope, $location, navigationService, con creatingFolder: false, }; + var disableTemplate = Umbraco.Sys.ServerVariables.disabledFeatures.disableTemplate; + $scope.model.disableTemplate = disableTemplate; + var node = $scope.dialogOptions.currentNode, localizeCreateFolder = localizationService.localize("defaultdialog_createFolder"); - $scope.showCreateFolder = function() { + $scope.showCreateFolder = function () { $scope.model.creatingFolder = true; }; - $scope.createContainer = function() { + $scope.createContainer = function () { - if (formHelper.submitForm({scope: $scope, formCtrl: this.createFolderForm, statusMessage: localizeCreateFolder})) { + if (formHelper.submitForm({ scope: $scope, formCtrl: this.createFolderForm, statusMessage: localizeCreateFolder })) { - contentTypeResource.createContainer(node.id, $scope.model.folderName).then(function(folderId) { + contentTypeResource.createContainer(node.id, $scope.model.folderName).then(function (folderId) { navigationService.hideMenu(); @@ -44,7 +47,7 @@ function DocumentTypesCreateController($scope, $location, navigationService, con var section = appState.getSectionState("currentSection"); - }, function(err) { + }, function (err) { $scope.error = err; @@ -58,14 +61,17 @@ function DocumentTypesCreateController($scope, $location, navigationService, con } }; - $scope.createDocType = function() { - $location.search('create', null); - $location.search('notemplate', null); - $location.path("/settings/documenttypes/edit/" + node.id).search("create", "true"); - navigationService.hideMenu(); - }; + // Disabling logic for creating document type with template if disableTemplate is set to true + if (!disableTemplate) { + $scope.createDocType = function () { + $location.search('create', null); + $location.search('notemplate', null); + $location.path("/settings/documenttypes/edit/" + node.id).search("create", "true"); + navigationService.hideMenu(); + }; + } - $scope.createComponent = function() { + $scope.createComponent = function () { $location.search('create', null); $location.search('notemplate', null); $location.path("/settings/documenttypes/edit/" + node.id).search("create", "true").search("notemplate", "true"); diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.html index b61a4c014e..6de2a4ff67 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/create.html @@ -4,7 +4,7 @@
Create an item under {{currentNode.name}}