From ba519ce420cdd5472315ee1bd5f1e1c34932414f Mon Sep 17 00:00:00 2001 From: Aaron Sadler Date: Mon, 26 Jul 2021 17:37:31 +0100 Subject: [PATCH] Updated UI files --- .../UmbNav/js/umbnav.controller.js | 11 +- .../UmbNav/js/umbnav.settings.controller.js | 20 +- TestSite.V9/App_Plugins/UmbNav/lang/en-us.xml | 6 + .../App_Plugins/UmbNav/views/editor.html | 2 +- .../App_Plugins/UmbNav/views/settings.html | 180 ++++++++++-------- TestSite.V9/TestSite.V9.csproj | 5 +- .../UmbNav/js/umbnav.controller.js | 11 +- .../UmbNav/js/umbnav.settings.controller.js | 16 +- .../App_Plugins/UmbNav/lang/en-us.xml | 6 + .../App_Plugins/UmbNav/views/editor.html | 2 +- .../App_Plugins/UmbNav/views/settings.html | 177 +++++++++-------- 11 files changed, 259 insertions(+), 177 deletions(-) diff --git a/TestSite.V9/App_Plugins/UmbNav/js/umbnav.controller.js b/TestSite.V9/App_Plugins/UmbNav/js/umbnav.controller.js index eaaf8e1..10b19ae 100644 --- a/TestSite.V9/App_Plugins/UmbNav/js/umbnav.controller.js +++ b/TestSite.V9/App_Plugins/UmbNav/js/umbnav.controller.js @@ -2,6 +2,7 @@ var vm = this; var dialogOptions = $scope.model; vm.wideMode = Object.toBoolean(dialogOptions.config.hideLabel); + vm.allowChildNodes = Object.toBoolean(!dialogOptions.config.hideIncludeChildren); vm.items = []; if (dialogOptions.config.expandOnHoverTimeout > 0) { @@ -83,6 +84,10 @@ function openSettings(item, callback) { + if (item != null && item.itemType == null) { + item.itemType = 'link'; + } + var settingsEditor = { title: "Settings", view: "/App_Plugins/UmbNav/Views/settings.html", @@ -92,6 +97,7 @@ allowDisplay: dialogOptions.config.allowDisplay, allowCustomClasses: dialogOptions.config.allowCustomClasses, allowImageIcon: dialogOptions.config.allowImageIcon, + hideIncludeChildren: dialogOptions.config.hideIncludeChildren, currentTarget: item, submit: function (model) { model.target.description = model.target.url + model.target.anchor; @@ -145,13 +151,14 @@ customClasses: data.customClasses, imageUrl: data.imageUrl, anchor: data.anchor, - url: url || "#", + url: url, children: data.children || [], icon: data.icon || "icon-link", published: data.published, naviHide: data.naviHide, culture: data.culture, - includeChildNodes: data.includeChildren + includeChildNodes: data.includeChildren, + itemType: data.itemType } } } diff --git a/TestSite.V9/App_Plugins/UmbNav/js/umbnav.settings.controller.js b/TestSite.V9/App_Plugins/UmbNav/js/umbnav.settings.controller.js index da5898e..b96aa18 100644 --- a/TestSite.V9/App_Plugins/UmbNav/js/umbnav.settings.controller.js +++ b/TestSite.V9/App_Plugins/UmbNav/js/umbnav.settings.controller.js @@ -11,10 +11,7 @@ vm.toggleChildren = toggleChildren; vm.showAdvanced = false; vm.labels = {}; - vm.labels.itemTypes = [ - { 'value': 'link', 'label': 'Link' }, - { 'value': 'label', 'label': 'Label' } - ]; + vm.labels.itemTypes = {}; localizationService.localizeMany(['defaultdialogs_openInNewWindow']).then(function (data) { vm.labels.openInNewWindow = data[0]; }); @@ -40,11 +37,20 @@ vm.labels.imageIconUrl = data[0]; }); localizationService.localizeMany(['umbnav_link']).then(function (data) { - vm.labels.link = data[0]; + vm.labels.itemTypes.link = { 'value': 'link', 'label': data[0] }; + }); + localizationService.localizeMany(['umbnav_label']).then(function (data) { + vm.labels.itemTypes.label = { 'value': 'nolink', 'label': data[0] }; + }); + localizationService.localizeMany(['umbnav_menuItem']).then(function (data) { + vm.labels.menuItem = data[0]; }); localizationService.localizeMany(['umbnav_configuration']).then(function (data) { vm.labels.configuration = data[0]; }); + localizationService.localizeMany(['umbnav_linkTypeDescription']).then(function (data) { + vm.labels.linkTypeDescription = data[0]; + }); if (!$scope.model.title) { localizationService.localize('defaultdialogs_selectLink').then(function (value) { $scope.model.title = value; @@ -64,7 +70,7 @@ $scope.showTarget = $scope.model.hideTarget !== true; $scope.showDisplay = $scope.model.allowDisplay === true; $scope.showNoopener = $scope.model.hideNoopener !== true; - $scope.showNoreferrer = $scope.model.hideNoreferrer!== true; + $scope.showNoreferrer = $scope.model.hideNoreferrer !== true; $scope.showAnchor = $scope.model.hideAnchor !== true; $scope.showIncludeChildren = $scope.model.hideIncludeChildren !== true; $scope.showCustomClasses = $scope.model.allowCustomClasses === true; @@ -135,7 +141,7 @@ vm.openInNewWindow = $scope.model.target.target === '_blank'; vm.hideLoggedIn = $scope.model.target.hideLoggedIn; vm.hideLoggedOut = $scope.model.target.hideLoggedOut; - vm.includeChildren = $scope.model.target.includeChildren; + vm.includeChildren = $scope.model.target.includeChildNodes; vm.showNoopener = $scope.model.target.noopener === 'noopener' && $scope.model.target.id === null || $scope.model.target.udi === null; vm.showNoreferrer = $scope.model.target.noreferrer === 'noreferrer' && $scope.model.target.id === null || $scope.model.target.udi === null; } else if (dialogOptions.anchors) { diff --git a/TestSite.V9/App_Plugins/UmbNav/lang/en-us.xml b/TestSite.V9/App_Plugins/UmbNav/lang/en-us.xml index c6bd046..11520c2 100644 --- a/TestSite.V9/App_Plugins/UmbNav/lang/en-us.xml +++ b/TestSite.V9/App_Plugins/UmbNav/lang/en-us.xml @@ -22,5 +22,11 @@ Image/Icon Url, id, udi or GUID Advanced Configuration Link + Label + Menu Item + Title + Menu Item Type + Select menu item type + Select menu item type \ No newline at end of file diff --git a/TestSite.V9/App_Plugins/UmbNav/views/editor.html b/TestSite.V9/App_Plugins/UmbNav/views/editor.html index ec87cdb..54a4088 100644 --- a/TestSite.V9/App_Plugins/UmbNav/views/editor.html +++ b/TestSite.V9/App_Plugins/UmbNav/views/editor.html @@ -42,7 +42,7 @@
-
{{ item.title || item.name }}
+
{{ item.title || item.name }}
{{ item.description }}
diff --git a/TestSite.V9/App_Plugins/UmbNav/views/settings.html b/TestSite.V9/App_Plugins/UmbNav/views/settings.html index 65bd228..2d2acb5 100644 --- a/TestSite.V9/App_Plugins/UmbNav/views/settings.html +++ b/TestSite.V9/App_Plugins/UmbNav/views/settings.html @@ -11,99 +11,120 @@ - + - -
- - - + +
+
+ +
+ {{vm.labels.linkTypeDescription}} +
+
+
+
+
+
+ + + + + + + + + + + + +
+ + {{model.target.name}} - + - - - - + ng-model="model.target.title" + ng-required="!model.target.name" /> -
- - {{model.target.name}} - - - - - -
-
- Link to page -
- -
- - - -
- - - - -
- - +
+
+ Link to page +
+ +
+ + + +
+ + + + +
+ + +
-
- - + + +
+
+
+ + +
- - + @@ -134,7 +155,6 @@
text="{{vm.labels.includeChildNodes}}"> - - - true - Always - + diff --git a/src/UmbNav.Web/App_Plugins/UmbNav/js/umbnav.controller.js b/src/UmbNav.Web/App_Plugins/UmbNav/js/umbnav.controller.js index eaaf8e1..10b19ae 100644 --- a/src/UmbNav.Web/App_Plugins/UmbNav/js/umbnav.controller.js +++ b/src/UmbNav.Web/App_Plugins/UmbNav/js/umbnav.controller.js @@ -2,6 +2,7 @@ var vm = this; var dialogOptions = $scope.model; vm.wideMode = Object.toBoolean(dialogOptions.config.hideLabel); + vm.allowChildNodes = Object.toBoolean(!dialogOptions.config.hideIncludeChildren); vm.items = []; if (dialogOptions.config.expandOnHoverTimeout > 0) { @@ -83,6 +84,10 @@ function openSettings(item, callback) { + if (item != null && item.itemType == null) { + item.itemType = 'link'; + } + var settingsEditor = { title: "Settings", view: "/App_Plugins/UmbNav/Views/settings.html", @@ -92,6 +97,7 @@ allowDisplay: dialogOptions.config.allowDisplay, allowCustomClasses: dialogOptions.config.allowCustomClasses, allowImageIcon: dialogOptions.config.allowImageIcon, + hideIncludeChildren: dialogOptions.config.hideIncludeChildren, currentTarget: item, submit: function (model) { model.target.description = model.target.url + model.target.anchor; @@ -145,13 +151,14 @@ customClasses: data.customClasses, imageUrl: data.imageUrl, anchor: data.anchor, - url: url || "#", + url: url, children: data.children || [], icon: data.icon || "icon-link", published: data.published, naviHide: data.naviHide, culture: data.culture, - includeChildNodes: data.includeChildren + includeChildNodes: data.includeChildren, + itemType: data.itemType } } } diff --git a/src/UmbNav.Web/App_Plugins/UmbNav/js/umbnav.settings.controller.js b/src/UmbNav.Web/App_Plugins/UmbNav/js/umbnav.settings.controller.js index 59bbdeb..b96aa18 100644 --- a/src/UmbNav.Web/App_Plugins/UmbNav/js/umbnav.settings.controller.js +++ b/src/UmbNav.Web/App_Plugins/UmbNav/js/umbnav.settings.controller.js @@ -11,6 +11,7 @@ vm.toggleChildren = toggleChildren; vm.showAdvanced = false; vm.labels = {}; + vm.labels.itemTypes = {}; localizationService.localizeMany(['defaultdialogs_openInNewWindow']).then(function (data) { vm.labels.openInNewWindow = data[0]; }); @@ -36,11 +37,20 @@ vm.labels.imageIconUrl = data[0]; }); localizationService.localizeMany(['umbnav_link']).then(function (data) { - vm.labels.link = data[0]; + vm.labels.itemTypes.link = { 'value': 'link', 'label': data[0] }; + }); + localizationService.localizeMany(['umbnav_label']).then(function (data) { + vm.labels.itemTypes.label = { 'value': 'nolink', 'label': data[0] }; + }); + localizationService.localizeMany(['umbnav_menuItem']).then(function (data) { + vm.labels.menuItem = data[0]; }); localizationService.localizeMany(['umbnav_configuration']).then(function (data) { vm.labels.configuration = data[0]; }); + localizationService.localizeMany(['umbnav_linkTypeDescription']).then(function (data) { + vm.labels.linkTypeDescription = data[0]; + }); if (!$scope.model.title) { localizationService.localize('defaultdialogs_selectLink').then(function (value) { $scope.model.title = value; @@ -60,7 +70,7 @@ $scope.showTarget = $scope.model.hideTarget !== true; $scope.showDisplay = $scope.model.allowDisplay === true; $scope.showNoopener = $scope.model.hideNoopener !== true; - $scope.showNoreferrer = $scope.model.hideNoreferrer!== true; + $scope.showNoreferrer = $scope.model.hideNoreferrer !== true; $scope.showAnchor = $scope.model.hideAnchor !== true; $scope.showIncludeChildren = $scope.model.hideIncludeChildren !== true; $scope.showCustomClasses = $scope.model.allowCustomClasses === true; @@ -131,7 +141,7 @@ vm.openInNewWindow = $scope.model.target.target === '_blank'; vm.hideLoggedIn = $scope.model.target.hideLoggedIn; vm.hideLoggedOut = $scope.model.target.hideLoggedOut; - vm.includeChildren = $scope.model.target.includeChildren; + vm.includeChildren = $scope.model.target.includeChildNodes; vm.showNoopener = $scope.model.target.noopener === 'noopener' && $scope.model.target.id === null || $scope.model.target.udi === null; vm.showNoreferrer = $scope.model.target.noreferrer === 'noreferrer' && $scope.model.target.id === null || $scope.model.target.udi === null; } else if (dialogOptions.anchors) { diff --git a/src/UmbNav.Web/App_Plugins/UmbNav/lang/en-us.xml b/src/UmbNav.Web/App_Plugins/UmbNav/lang/en-us.xml index c6bd046..11520c2 100644 --- a/src/UmbNav.Web/App_Plugins/UmbNav/lang/en-us.xml +++ b/src/UmbNav.Web/App_Plugins/UmbNav/lang/en-us.xml @@ -22,5 +22,11 @@ Image/Icon Url, id, udi or GUID Advanced Configuration Link + Label + Menu Item + Title + Menu Item Type + Select menu item type + Select menu item type \ No newline at end of file diff --git a/src/UmbNav.Web/App_Plugins/UmbNav/views/editor.html b/src/UmbNav.Web/App_Plugins/UmbNav/views/editor.html index ec87cdb..54a4088 100644 --- a/src/UmbNav.Web/App_Plugins/UmbNav/views/editor.html +++ b/src/UmbNav.Web/App_Plugins/UmbNav/views/editor.html @@ -42,7 +42,7 @@
-
{{ item.title || item.name }}
+
{{ item.title || item.name }}
{{ item.description }}
diff --git a/src/UmbNav.Web/App_Plugins/UmbNav/views/settings.html b/src/UmbNav.Web/App_Plugins/UmbNav/views/settings.html index eb98012..2d2acb5 100644 --- a/src/UmbNav.Web/App_Plugins/UmbNav/views/settings.html +++ b/src/UmbNav.Web/App_Plugins/UmbNav/views/settings.html @@ -11,96 +11,120 @@ - + -
- - - + +
+
+ +
+ {{vm.labels.linkTypeDescription}} +
+
+
+
+
+
+ + + + + + + + + + + + +
+ + {{model.target.name}} - + - - - - + ng-model="model.target.title" + ng-required="!model.target.name" /> -
- - {{model.target.name}} - - - - - -
-
- Link to page -
- -
- - - -
- - - - -
- - +
+
+ Link to page +
+ +
+ + + +
+ + + + +
+ + +
-
- - + + +
+
+
+ + +
- - + @@ -131,7 +155,6 @@
text="{{vm.labels.includeChildNodes}}"> -