@@ -892,7 +892,7 @@
}
@CurrentPage.BodyText
-
+
@@ -921,4 +921,4 @@
-
\ No newline at end of file
+
diff --git a/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs b/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs
index d7dcf8e79a..6de467f32f 100644
--- a/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs
+++ b/src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs
@@ -359,7 +359,7 @@ namespace Umbraco.Tests.TestHelpers.Entities
contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Nvarchar) { Alias = "singleLineText", Name = "Text String", Mandatory = false, SortOrder = 4, DataTypeId = -88 });
contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.TextArea, ValueStorageType.Ntext) { Alias = "multilineText", Name = "Multiple Text Strings", Mandatory = false, SortOrder = 5, DataTypeId = -89 });
contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.UploadField, ValueStorageType.Nvarchar) { Alias = "upload", Name = "Upload Field", Mandatory = false, SortOrder = 6, DataTypeId = -90 });
- contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.NoEdit, ValueStorageType.Nvarchar) { Alias = "label", Name = "Label", Mandatory = false, SortOrder = 7, DataTypeId = -92 });
+ contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Nvarchar) { Alias = "label", Name = "Label", Mandatory = false, SortOrder = 7, DataTypeId = -92 });
contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.DateTime, ValueStorageType.Date) { Alias = "dateTime", Name = "Date Time", Mandatory = false, SortOrder = 8, DataTypeId = -36 });
contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.ColorPicker, ValueStorageType.Nvarchar) { Alias = "colorPicker", Name = "Color Picker", Mandatory = false, SortOrder = 9, DataTypeId = -37 });
contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.DropDownListFlexible, ValueStorageType.Nvarchar) { Alias = "ddlMultiple", Name = "Dropdown List Multiple", Mandatory = false, SortOrder = 11, DataTypeId = -39 });
@@ -420,10 +420,10 @@ namespace Umbraco.Tests.TestHelpers.Entities
var contentCollection = new PropertyTypeCollection(false);
contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.UploadField, ValueStorageType.Nvarchar) { Alias = Constants.Conventions.Media.File, Name = "File", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -90 });
- contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.NoEdit, ValueStorageType.Integer) { Alias = Constants.Conventions.Media.Width, Name = "Width", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -90 });
- contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.NoEdit, ValueStorageType.Integer) { Alias = Constants.Conventions.Media.Height, Name = "Height", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -90 });
- contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.NoEdit, ValueStorageType.Integer) { Alias = Constants.Conventions.Media.Bytes, Name = "Bytes", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -90 });
- contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.NoEdit, ValueStorageType.Nvarchar) { Alias = Constants.Conventions.Media.Extension, Name = "File Extension", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -90 });
+ contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Integer) { Alias = Constants.Conventions.Media.Width, Name = "Width", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -90 });
+ contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Integer) { Alias = Constants.Conventions.Media.Height, Name = "Height", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -90 });
+ contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Integer) { Alias = Constants.Conventions.Media.Bytes, Name = "Bytes", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -90 });
+ contentCollection.Add(new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Nvarchar) { Alias = Constants.Conventions.Media.Extension, Name = "File Extension", Description = "", Mandatory = false, SortOrder = 2, DataTypeId = -90 });
mediaType.PropertyGroups.Add(new PropertyGroup(contentCollection) { Name = "Media", SortOrder = 1 });
diff --git a/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs b/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs
index 97fffe11dd..572d572ab7 100644
--- a/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs
+++ b/src/Umbraco.Tests/TestHelpers/SettingsForTests.cs
@@ -21,6 +21,7 @@ namespace Umbraco.Tests.TestHelpers
settings.TimeOutInMinutes == 20 &&
settings.DefaultUILanguage == "en" &&
settings.LocalTempStorageLocation == LocalTempStorage.Default &&
+ settings.LocalTempPath == IOHelper.MapPath("~/App_Data/TEMP") &&
settings.ReservedPaths == (GlobalSettings.StaticReservedPaths + "~/umbraco") &&
settings.ReservedUrls == GlobalSettings.StaticReservedUrls);
return config;
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
index 03ed7aadaf..e6b8bae30c 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
@@ -4,7 +4,7 @@
function ContentEditController($rootScope, $scope, $routeParams, $q, $window,
appState, contentResource, entityResource, navigationService, notificationsService,
serverValidationManager, contentEditingHelper, treeService, formHelper, umbRequestHelper,
- editorState, $http, eventsService, relationResource, overlayService) {
+ editorState, $http, eventsService, relationResource, overlayService, $location) {
var evts = [];
var infiniteMode = $scope.infiniteModel && $scope.infiniteModel.infiniteMode;
@@ -22,7 +22,7 @@
$scope.page.isNew = $scope.isNew ? true : false;
$scope.page.buttonGroupState = "init";
$scope.page.hideActionsMenu = infiniteMode ? true : false;
- $scope.page.hideChangeVariant = infiniteMode ? true : false;
+ $scope.page.hideChangeVariant = false;
$scope.allowOpen = true;
$scope.app = null;
@@ -213,24 +213,7 @@
$scope.page.showPreviewButton = true;
}
-
- // create infinite editing buttons
- function createInfiniteModeButtons(content) {
-
- $scope.page.allowInfinitePublishAndClose = false;
- $scope.page.allowInfiniteSaveAndClose = false;
-
- // check for publish rights
- if (_.contains(content.allowedActions, "U")) {
- $scope.page.allowInfinitePublishAndClose = true;
-
- // check for save rights
- } else if (_.contains(content.allowedActions, "A")) {
- $scope.page.allowInfiniteSaveAndClose = true;
- }
-
- }
-
+
/** Syncs the content item to it's tree node - this occurs on first load and after saving */
function syncTreeNode(content, path, initialLoad) {
@@ -874,11 +857,8 @@
$scope.$broadcast("editors.apps.appChanged", { app: app });
- if (infiniteMode) {
- createInfiniteModeButtons($scope.content);
- } else {
- createButtons($scope.content);
- }
+ createButtons($scope.content);
+
};
/**
@@ -896,6 +876,18 @@
$scope.infiniteModel.close($scope.infiniteModel);
}
};
+
+ /**
+ * Call back when user click the back-icon
+ */
+ $scope.onBack = function() {
+ if ($scope.infiniteModel && $scope.infiniteModel.close) {
+ $scope.infiniteModel.close($scope.infiniteModel);
+ } else {
+ // navigate backwards if content has a parent.
+ $location.path('/' + $routeParams.section + '/' + $routeParams.tree + '/' + $routeParams.method + '/' + $scope.content.parentId);
+ }
+ };
//ensure to unregister from all events!
$scope.$on('$destroy', function () {
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontent.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontent.directive.js
index 5556308e06..effa21e581 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontent.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontent.directive.js
@@ -17,7 +17,9 @@
onSelectVariant: "&",
onOpenSplitView: "&",
onSelectApp: "&",
- onSelectAppAnchor: "&"
+ onSelectAppAnchor: "&",
+ onBack: "&?",
+ showBack: ""
},
controllerAs: 'vm',
controller: umbVariantContentController
@@ -37,6 +39,7 @@
vm.openSplitView = openSplitView;
vm.selectApp = selectApp;
vm.selectAppAnchor = selectAppAnchor;
+ vm.showBackButton = showBackButton;
function onInit() {
// disable the name field if the active content app is not "Content"
@@ -48,6 +51,10 @@
});
}
+ function showBackButton() {
+ return vm.page.listViewPath !== null && vm.showBack;
+ }
+
/** Called when the component has linked all elements, this is when the form controller is available */
function postLink() {
//set the content to dirty if the header changes
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontenteditors.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontenteditors.directive.js
index bd21cca541..3f67b74380 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontenteditors.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontenteditors.directive.js
@@ -11,7 +11,9 @@
content: "<", // TODO: Not sure if this should be = since we are changing the 'active' property of a variant
culture: "<",
onSelectApp: "&?",
- onSelectAppAnchor: "&?"
+ onSelectAppAnchor: "&?",
+ onBack: "&?",
+ showBack: ""
},
controllerAs: 'vm',
controller: umbVariantContentEditorsController
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorcontentheader.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorcontentheader.directive.js
index c1c42911fa..4999f7007a 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorcontentheader.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorcontentheader.directive.js
@@ -1,7 +1,7 @@
(function () {
'use strict';
- function EditorContentHeader($location, $routeParams) {
+ function EditorContentHeader() {
function link(scope, el, attr, ctrl) {
@@ -37,7 +37,9 @@
}
scope.goBack = function () {
- $location.path('/' + $routeParams.section + '/' + $routeParams.tree + '/' + $routeParams.method + '/' + scope.menu.currentNode.parentId);
+ if (scope.onBack) {
+ scope.onBack();
+ }
};
scope.selectVariant = function (event, variant) {
@@ -113,13 +115,14 @@
name: "=",
nameDisabled: "",
menu: "=",
- hideMenu: "",
+ hideActionsMenu: "",
content: "=",
openVariants: "<",
hideChangeVariant: "",
onSelectNavigationItem: "&?",
onSelectAnchorItem: "&?",
showBackButton: "",
+ onBack: "&?",
splitViewOpen: "=?",
onOpenInSplitView: "&?",
onCloseSplitView: "&?",
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 f01083d725..76c2e585f8 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
@@ -258,7 +258,7 @@ Use this directive to construct a header inside the main editor window.
name: "=",
nameLocked: "=",
menu: "=",
- hideMenu: "",
+ hideActionsMenu: "",
icon: "=",
hideIcon: "@",
alias: "=",
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditornavigation.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditornavigation.directive.js
index 31976118fd..eec8455969 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditornavigation.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditornavigation.directive.js
@@ -46,18 +46,15 @@
};
function onInit() {
-
- // hide navigation if there is only 1 item
- if (scope.navigation.length <= 1) {
- scope.showNavigation = false;
- }
-
- $timeout(function(){
- if($window && $window.innerWidth) {
- calculateVisibleItems($window.innerWidth);
- }
- });
-
+ var firstRun = true;
+ scope.$watch("navigation.length",
+ (newVal, oldVal) => {
+ if (firstRun || newVal !== undefined && newVal !== oldVal) {
+ firstRun = false;
+ scope.showNavigation = newVal > 1;
+ calculateVisibleItems($window.innerWidth);
+ }
+ });
}
function calculateVisibleItems(windowWidth) {
diff --git a/src/Umbraco.Web.UI.Client/src/routes.js b/src/Umbraco.Web.UI.Client/src/routes.js
index ecb011e3f0..001888f3ca 100644
--- a/src/Umbraco.Web.UI.Client/src/routes.js
+++ b/src/Umbraco.Web.UI.Client/src/routes.js
@@ -157,6 +157,7 @@ app.config(function ($routeProvider) {
return;
}
+ //TODO: Fix this special case by using components, the packager should be a component and then we just have a view for each route like normal rendering the component with the correct parameters
//special case for the package section
var packagePages = ["edit", "options"];
if ($routeParams.section.toLowerCase() === "packages" && $routeParams.tree.toLowerCase() === "packages" && packagePages.indexOf($routeParams.method.toLowerCase()) === -1) {
@@ -164,6 +165,7 @@ app.config(function ($routeProvider) {
return;
}
+ //TODO: Fix this special case by using components, the users section should be a component and then we just have a view for each route like normal rendering the component with the correct parameters
//special case for the users section
var usersPages = ["user", "group"];
if ($routeParams.section.toLowerCase() === "users" && $routeParams.tree.toLowerCase() === "users" && usersPages.indexOf($routeParams.method.toLowerCase()) === -1) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html
index 1f38d61469..cd2c94c458 100644
--- a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html
+++ b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html
@@ -11,7 +11,10 @@
content="content"
culture="culture"
on-select-app="appChanged(app)"
- on-select-app-anchor="appAnchorChanged(app, anchor)">
+ on-select-app-anchor="appAnchorChanged(app, anchor)"
+ on-back="onBack()"
+ show-back="!(infiniteModel && infiniteModel.infiniteMode)"
+ >
@@ -59,7 +62,7 @@
+ on-select-app-anchor="vm.selectAppAnchor(app, anchor)"
+ on-back="vm.onBack()"
+ show-back="vm.showBack">
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html
index 34c7792055..94fb7edae8 100644
--- a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html
+++ b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-variant-content.html
@@ -16,7 +16,8 @@
on-select-anchor-item="vm.selectAppAnchor(item, anchor)"
open-variants="vm.openVariants"
hide-change-variant="vm.page.hideChangeVariant"
- show-back-button="vm.page.listViewPath !== null"
+ show-back-button="vm.showBackButton()"
+ on-back="vm.onBack()"
split-view-open="vm.editorCount > 1"
on-open-in-split-view="vm.openSplitView(variant)"
on-close-split-view="vm.onCloseSplitView()"
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html
index 09d46fcf4c..227a08c54f 100644
--- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html
+++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-content-header.html
@@ -69,7 +69,7 @@
-