diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-mini-list-view.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-mini-list-view.less index 8cd08f5045..ecb1ad1904 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-mini-list-view.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-mini-list-view.less @@ -44,6 +44,10 @@ color: @black; } +.umb-minilistview { + overflow: hidden; +} + /* Animations */ .umb-mini-list-view.ng-animate { transition: 120ms cubic-bezier(0.250, 0.250, 0.750, 0.750) all; 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 b0548e403c..ab7274df6f 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 @@ -38,6 +38,7 @@ action="close()" button-style="link" label-key="general_close" + shortcut="esc" type="button"> diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js index 238872db40..b78f4819c5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js @@ -3,16 +3,19 @@ * The controller that is used for a couple different Property Editors: Multi Node Tree Picker, Content Picker, * since this is used by MNTP and it supports content, media and members, there is code to deal with all 3 of those types * @param {any} $scope + * @param {any} $q + * @param {any} $routeParams + * @param {any} $location * @param {any} entityResource * @param {any} editorState * @param {any} iconHelper - * @param {any} $routeParams * @param {any} angularHelper * @param {any} navigationService - * @param {any} $location * @param {any} localizationService + * @param {any} editorService + * @param {any} userService */ -function contentPickerController($scope, entityResource, editorState, iconHelper, $routeParams, angularHelper, navigationService, $location, localizationService, editorService, $q) { +function contentPickerController($scope, $q, $routeParams, $location, entityResource, editorState, iconHelper, angularHelper, navigationService, localizationService, editorService, userService) { var vm = { labels: { @@ -139,7 +142,8 @@ function contentPickerController($scope, entityResource, editorState, iconHelper : $scope.model.config.startNode.type === "media" ? "Media" : "Document"; - $scope.allowOpenButton = entityType === "Document"; + + $scope.allowOpenButton = false; $scope.allowEditButton = entityType === "Document"; $scope.allowRemoveButton = true; @@ -303,16 +307,24 @@ function contentPickerController($scope, entityResource, editorState, iconHelper $scope.model.value = null; }; - $scope.openContentEditor = function (node) { - var contentEditor = { - id: node.id, + $scope.openEditor = function (item) { + var editor = { + id: entityType === "Member" ? item.key : item.id, submit: function (model) { + + var node = entityType === "Member" ? model.memberNode : + entityType === "Media" ? model.mediaNode : + model.contentNode; + // update the node - node.name = model.contentNode.name; - node.published = model.contentNode.hasPublishedVersion; + item.name = node.name; + if (entityType !== "Member") { - entityResource.getUrl(model.contentNode.id, entityType).then(function (data) { - node.url = data; + if (entityType === "Document") { + item.published = node.hasPublishedVersion; + } + entityResource.getUrl(node.id, entityType).then(function (data) { + item.url = data; }); } editorService.close(); @@ -321,7 +333,18 @@ function contentPickerController($scope, entityResource, editorState, iconHelper editorService.close(); } }; - editorService.contentEditor(contentEditor); + + switch (entityType) { + case "Document": + editorService.contentEditor(editor); + break; + case "Media": + editorService.mediaEditor(editor); + break; + case "Member": + editorService.memberEditor(editor); + break; + } }; //when the scope is destroyed we need to unsubscribe @@ -466,6 +489,7 @@ function contentPickerController($scope, entityResource, editorState, iconHelper "icon": item.icon, "path": item.path, "url": item.url, + "key": item.key, "trashed": item.trashed, "published": (item.metaData && item.metaData.IsPublished === false && entityType === "Document") ? false : true // only content supports published/unpublished content so we set everything else to published so the UI looks correct @@ -484,6 +508,26 @@ function contentPickerController($scope, entityResource, editorState, iconHelper } function init() { + + userService.getCurrentUser().then(function (user) { + switch (entityType) { + case "Document": + var hasAccessToContent = user.allowedSections.indexOf("content") !== -1; + $scope.allowOpenButton = hasAccessToContent; + break; + case "Media": + var hasAccessToMedia = user.allowedSections.indexOf("media") !== -1; + $scope.allowOpenButton = hasAccessToMedia; + break; + case "Member": + var hasAccessToMember = user.allowedSections.indexOf("member") !== -1; + $scope.allowOpenButton = hasAccessToMember; + break; + + default: + } + }); + localizationService.localizeMany(["general_recycleBin", "general_add"]) .then(function(data) { vm.labels.general_recycleBin = data[0]; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html index ba22ca9d80..1a17ea2698 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.html @@ -15,7 +15,7 @@ allow-remove="allowRemoveButton" allow-open="model.config.showOpenButton && allowOpenButton && !dialogEditor" on-remove="remove($index)" - on-open="openContentEditor(node)"> + on-open="openEditor(node)">