From 160518e97720b6dab0a12c82fb5f2c6f14e31cac Mon Sep 17 00:00:00 2001 From: Claus Date: Mon, 12 Jun 2017 12:12:14 +0200 Subject: [PATCH 1/2] adding guids to backoffice. --- .../editor/umbeditorheader.directive.js | 3 +- src/Umbraco.Web.UI.Client/src/less/panel.less | 6 ++++ .../components/editor/umb-editor-header.html | 4 ++- .../src/views/datatypes/edit.html | 1 + .../src/views/documenttypes/edit.html | 1 + .../src/views/mediatypes/edit.html | 1 + .../src/views/templates/edit.html | 1 + .../umbraco/developer/Macros/editMacro.aspx | 3 ++ .../Models/ContentEditing/TemplateDisplay.cs | 7 ++--- .../Models/Mapping/TemplateModelMapper.cs | 1 - .../developer/Macros/editMacro.aspx.cs | 28 +++++++++++++------ 11 files changed, 40 insertions(+), 16 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js index 4d9222fa45..8ef43df47b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorheader.directive.js @@ -255,7 +255,8 @@ Use this directive to construct a header inside the main editor window. description: "=", hideDescription: "@", descriptionLocked: "@", - navigation: "=" + navigation: "=", + key: "=" }, link: link }; diff --git a/src/Umbraco.Web.UI.Client/src/less/panel.less b/src/Umbraco.Web.UI.Client/src/less/panel.less index 6bc2a2b2de..0446d9752b 100644 --- a/src/Umbraco.Web.UI.Client/src/less/panel.less +++ b/src/Umbraco.Web.UI.Client/src/less/panel.less @@ -489,6 +489,12 @@ input.umb-panel-header-description { line-height: 25px; } +.umb-panel-header-key { + font-size: 10px; + margin-left: 8px; + color: #adadad; +} + .umb-editor-drawer-content { display: flex; align-items: center; diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-header.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-header.html index f55b587c04..9a84a1a645 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-header.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-header.html @@ -47,7 +47,9 @@ ng-if="!hideDescription && !descriptionLocked" ng-model="$parent.description" /> -
{{ description }}
+
{{ description }}
+ +
{{ key }}
diff --git a/src/Umbraco.Web.UI.Client/src/views/datatypes/edit.html b/src/Umbraco.Web.UI.Client/src/views/datatypes/edit.html index fc53982b90..9f52357c31 100644 --- a/src/Umbraco.Web.UI.Client/src/views/datatypes/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/datatypes/edit.html @@ -12,6 +12,7 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.html b/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.html index 5bde09f8e0..f0d3a8fbf6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.html @@ -9,6 +9,7 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html index ec8ca3e9b4..2d59b644d0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html @@ -13,6 +13,7 @@ + + + diff --git a/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs index 91c1aefdb0..ffa4e4e100 100644 --- a/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs @@ -1,11 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; using System.Runtime.Serialization; -using System.Text; -using System.Threading.Tasks; -using Umbraco.Core.Models.Validation; namespace Umbraco.Web.Models.ContentEditing { @@ -24,6 +20,9 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "alias")] public string Alias { get; set; } + [DataMember(Name = "key")] + public Guid Key { get; set; } + [DataMember(Name = "content")] public string Content { get; set; } diff --git a/src/Umbraco.Web/Models/Mapping/TemplateModelMapper.cs b/src/Umbraco.Web/Models/Mapping/TemplateModelMapper.cs index 19677fccc8..6111941084 100644 --- a/src/Umbraco.Web/Models/Mapping/TemplateModelMapper.cs +++ b/src/Umbraco.Web/Models/Mapping/TemplateModelMapper.cs @@ -15,7 +15,6 @@ namespace Umbraco.Web.Models.Mapping config.CreateMap() .ForMember(x => x.DeletedDate, exp => exp.Ignore()) - .ForMember(x => x.Key, exp => exp.Ignore()) .ForMember(x => x.Path, exp => exp.Ignore()) .ForMember(x => x.CreateDate, exp => exp.Ignore()) .ForMember(x => x.UpdateDate, exp => exp.Ignore()) diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs index b40515578b..73800ca117 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs @@ -88,6 +88,7 @@ namespace umbraco.cms.presentation.developer { macroName.Text = macro.Name; macroAlias.Text = macro.Alias; + macroKey.Text = macro.Key.ToString(); macroXslt.Text = macro.XsltPath; macroPython.Text = macro.ScriptPath; cachePeriod.Text = macro.CacheDuration.ToInvariantString(); @@ -209,7 +210,7 @@ namespace umbraco.cms.presentation.developer } protected IEnumerable GetMacroParameterEditors() - { + { // we need to show the depracated ones for backwards compatibility return ParameterEditorResolver.Current.GetParameterEditors(true); } @@ -433,14 +434,23 @@ namespace umbraco.cms.presentation.developer /// protected global::System.Web.UI.WebControls.TextBox macroAlias; - /// - /// Pane1_2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane Pane1_2; + /// + /// macroAlias control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label macroKey; + + /// + /// Pane1_2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.uicontrols.Pane Pane1_2; /// /// macroXslt control. From e559a6d48516fd00abe027e80b06242367b0ea23 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 12 Jun 2017 14:55:12 +0200 Subject: [PATCH 2/2] add key as hover on name --- src/Umbraco.Web.UI.Client/src/less/panel.less | 6 ----- .../components/editor/umb-editor-header.html | 23 ++++++++++--------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/panel.less b/src/Umbraco.Web.UI.Client/src/less/panel.less index 0446d9752b..6bc2a2b2de 100644 --- a/src/Umbraco.Web.UI.Client/src/less/panel.less +++ b/src/Umbraco.Web.UI.Client/src/less/panel.less @@ -489,12 +489,6 @@ input.umb-panel-header-description { line-height: 25px; } -.umb-panel-header-key { - font-size: 10px; - margin-left: 8px; - color: #adadad; -} - .umb-editor-drawer-content { display: flex; align-items: center; diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-header.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-header.html index 9a84a1a645..fdc1ddf0f5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-header.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-header.html @@ -17,6 +17,7 @@ -
{{ name }}
+
{{ name }}
+ - + + +
{{ description }}
-
{{ description }}
- -
{{ key }}