+
Remove
+
+
+
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js
index 503caeb82d..ace6058b1d 100644
--- a/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/content/content.create.controller.js
@@ -6,11 +6,67 @@
* @description
* The controller for the content creation dialog
*/
-function contentCreateController($scope, $routeParams, contentTypeResource, iconHelper) {
-
- contentTypeResource.getAllowedTypes($scope.currentNode.id).then(function(data) {
- $scope.allowedTypes = iconHelper.formatContentTypeIcons(data);
+function contentCreateController($scope,
+ $routeParams,
+ contentTypeResource,
+ iconHelper,
+ $location,
+ navigationService,
+ blueprintConfig) {
+
+ function initialize() {
+ contentTypeResource.getAllowedTypes($scope.currentNode.id).then(function (data) {
+ $scope.allowedTypes = iconHelper.formatContentTypeIcons(data);
});
+
+ $scope.selectContentType = true;
+ $scope.selectBlueprint = false;
+ $scope.allowBlank = blueprintConfig.allowBlank;
+ }
+
+ function close() {
+ navigationService.hideMenu();
+ }
+
+ function createBlank(docType) {
+ $location
+ .path("/content/content/edit/" + $scope.currentNode.id)
+ .search("doctype=" + docType.alias + "&create=true");
+ close();
+ }
+
+ function createOrSelectBlueprintIfAny(docType) {
+ var blueprintIds = _.keys(docType.blueprints || {});
+ $scope.docType = docType;
+ if (blueprintIds.length) {
+ if (blueprintConfig.skipSelect) {
+ createFromBlueprint(blueprintIds[0]);
+ } else {
+ $scope.selectContentType = false;
+ $scope.selectBlueprint = true;
+ }
+ } else {
+ createBlank(docType);
+ }
+ }
+
+ function createFromBlueprint(blueprintId) {
+ $location
+ .path("/content/content/edit/" + $scope.currentNode.id)
+ .search("doctype=" + $scope.docType.alias + "&create=true&blueprintId=" + blueprintId);
+ close();
+ }
+
+ $scope.createBlank = createBlank;
+ $scope.createOrSelectBlueprintIfAny = createOrSelectBlueprintIfAny;
+ $scope.createFromBlueprint = createFromBlueprint;
+
+ initialize();
}
-angular.module('umbraco').controller("Umbraco.Editors.Content.CreateController", contentCreateController);
\ No newline at end of file
+angular.module("umbraco").controller("Umbraco.Editors.Content.CreateController", contentCreateController);
+
+angular.module("umbraco").value("blueprintConfig", {
+ skipSelect: false,
+ allowBlank: true
+});
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js
new file mode 100644
index 0000000000..69eb8c3034
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/content/content.createblueprint.controller.js
@@ -0,0 +1,56 @@
+(function () {
+
+ function CreateBlueprintController(
+ $scope,
+ contentResource,
+ notificationsService,
+ navigationService,
+ localizationService,
+ formHelper,
+ contentEditingHelper) {
+
+ $scope.message = {
+ name: $scope.currentNode.name
+ };
+
+ var successText = {};
+ localizationService.localize("blueprints_createBlueprintFrom", ["
" + $scope.message.name + ""]).then(function (localizedVal) {
+ $scope.title = localizedVal;
+ });
+
+
+
+ $scope.cancel = function () {
+ navigationService.hideMenu();
+ };
+
+ $scope.create = function () {
+ if (formHelper.submitForm({
+ scope: $scope,
+ formCtrl: this.blueprintForm,
+ statusMessage: "Creating blueprint..."
+ })) {
+
+ contentResource.createBlueprintFromContent($scope.currentNode.id, $scope.message.name)
+ .then(function(data) {
+
+ formHelper.resetForm({ scope: $scope, notifications: data.notifications });
+
+ navigationService.hideMenu();
+ },
+ function(err) {
+
+ contentEditingHelper.handleSaveError({
+ redirectOnFailure: false,
+ err: err
+ });
+
+ }
+ );
+ }
+ };
+ }
+
+ angular.module("umbraco").controller("Umbraco.Editors.Content.CreateBlueprintController", CreateBlueprintController);
+
+}());
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js
index e8e729fd72..94562c6a32 100644
--- a/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js
@@ -6,227 +6,21 @@
* @description
* The controller for the content editor
*/
-function ContentEditController($scope, $rootScope, $routeParams, $q, $timeout, $window, appState, contentResource, entityResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, treeService, fileManager, formHelper, umbRequestHelper, keyboardService, umbModelMapper, editorState, $http) {
+function ContentEditController($scope, $routeParams, contentResource) {
- //setup scope vars
- $scope.defaultButton = null;
- $scope.subButtons = [];
-
- $scope.page = {};
- $scope.page.loading = false;
- $scope.page.menu = {};
- $scope.page.menu.currentNode = null;
- $scope.page.menu.currentSection = appState.getSectionState("currentSection");
- $scope.page.listViewPath = null;
- $scope.page.isNew = $routeParams.create;
- $scope.page.buttonGroupState = "init";
-
- function init(content) {
-
- var buttons = contentEditingHelper.configureContentEditorButtons({
- create: $routeParams.create,
- content: content,
- methods: {
- saveAndPublish: $scope.saveAndPublish,
- sendToPublish: $scope.sendToPublish,
- save: $scope.save,
- unPublish: $scope.unPublish
- }
- });
- $scope.defaultButton = buttons.defaultButton;
- $scope.subButtons = buttons.subButtons;
-
- editorState.set($scope.content);
-
- //We fetch all ancestors of the node to generate the footer breadcrumb navigation
- if (!$routeParams.create) {
- if (content.parentId && content.parentId != -1) {
- entityResource.getAncestors(content.id, "document")
- .then(function (anc) {
- $scope.ancestors = anc;
- });
- }
- }
- }
-
- /** Syncs the content item to it's tree node - this occurs on first load and after saving */
- function syncTreeNode(content, path, initialLoad) {
-
- if (!$scope.content.isChildOfListView) {
- navigationService.syncTree({ tree: "content", path: path.split(","), forceReload: initialLoad !== true }).then(function (syncArgs) {
- $scope.page.menu.currentNode = syncArgs.node;
- });
- }
- else if (initialLoad === true) {
-
- //it's a child item, just sync the ui node to the parent
- navigationService.syncTree({ tree: "content", path: path.substring(0, path.lastIndexOf(",")).split(","), forceReload: initialLoad !== true });
-
- //if this is a child of a list view and it's the initial load of the editor, we need to get the tree node
- // from the server so that we can load in the actions menu.
- umbRequestHelper.resourcePromise(
- $http.get(content.treeNodeUrl),
- 'Failed to retrieve data for child node ' + content.id).then(function (node) {
- $scope.page.menu.currentNode = node;
- });
- }
- }
-
- // This is a helper method to reduce the amount of code repitition for actions: Save, Publish, SendToPublish
- function performSave(args) {
- var deferred = $q.defer();
-
- $scope.page.buttonGroupState = "busy";
-
- contentEditingHelper.contentEditorPerformSave({
- statusMessage: args.statusMessage,
- saveMethod: args.saveMethod,
- scope: $scope,
- content: $scope.content,
- action: args.action
- }).then(function (data) {
- //success
- init($scope.content);
- syncTreeNode($scope.content, data.path);
-
- $scope.page.buttonGroupState = "success";
-
- deferred.resolve(data);
- }, function (err) {
- //error
- if (err) {
- editorState.set($scope.content);
- }
-
- $scope.page.buttonGroupState = "error";
-
- deferred.reject(err);
- });
-
- return deferred.promise;
- }
-
- function resetLastListPageNumber(content) {
- // We're using rootScope to store the page number for list views, so if returning to the list
- // we can restore the page. If we've moved on to edit a piece of content that's not the list or it's children
- // we should remove this so as not to confuse if navigating to a different list
- if (!content.isChildOfListView && !content.isContainer) {
- $rootScope.lastListViewPageViewed = null;
- }
- }
-
- if ($routeParams.create) {
-
- $scope.page.loading = true;
-
- //we are creating so get an empty content item
- contentResource.getScaffold($routeParams.id, $routeParams.doctype)
- .then(function (data) {
-
- $scope.content = data;
-
- init($scope.content);
-
- resetLastListPageNumber($scope.content);
-
- $scope.page.loading = false;
-
- });
- }
- else {
-
- $scope.page.loading = true;
-
- //we are editing so get the content item from the server
- contentResource.getById($routeParams.id)
- .then(function (data) {
-
- $scope.content = data;
-
- if (data.isChildOfListView && data.trashed === false) {
- $scope.page.listViewPath = ($routeParams.page)
- ? "/content/content/edit/" + data.parentId + "?page=" + $routeParams.page
- : "/content/content/edit/" + data.parentId;
- }
-
- init($scope.content);
-
- //in one particular special case, after we've created a new item we redirect back to the edit
- // route but there might be server validation errors in the collection which we need to display
- // after the redirect, so we will bind all subscriptions which will show the server validation errors
- // if there are any and then clear them so the collection no longer persists them.
- serverValidationManager.executeAndClearAllSubscriptions();
-
- syncTreeNode($scope.content, data.path, true);
-
- resetLastListPageNumber($scope.content);
-
- $scope.page.loading = false;
-
- });
- }
-
-
- $scope.unPublish = function () {
-
- if (formHelper.submitForm({ scope: $scope, statusMessage: "Unpublishing...", skipValidation: true })) {
-
- $scope.page.buttonGroupState = "busy";
-
- contentResource.unPublish($scope.content.id)
- .then(function (data) {
-
- formHelper.resetForm({ scope: $scope, notifications: data.notifications });
-
- contentEditingHelper.handleSuccessfulSave({
- scope: $scope,
- savedContent: data,
- rebindCallback: contentEditingHelper.reBindChangedProperties($scope.content, data)
- });
-
- init($scope.content);
-
- syncTreeNode($scope.content, data.path);
-
- $scope.page.buttonGroupState = "success";
-
- });
- }
-
- };
-
- $scope.sendToPublish = function () {
- return performSave({ saveMethod: contentResource.sendToPublish, statusMessage: "Sending...", action: "sendToPublish" });
- };
-
- $scope.saveAndPublish = function () {
- return performSave({ saveMethod: contentResource.publish, statusMessage: "Publishing...", action: "publish" });
- };
-
- $scope.save = function () {
- return performSave({ saveMethod: contentResource.save, statusMessage: "Saving...", action: "save" });
- };
-
- $scope.preview = function (content) {
-
-
- if (!$scope.busy) {
-
- // Chromes popup blocker will kick in if a window is opened
- // outwith the initial scoped request. This trick will fix that.
- //
- var previewWindow = $window.open('preview/?id=' + content.id, 'umbpreview');
- $scope.save().then(function (data) {
- // Build the correct path so both /#/ and #/ work.
- var redirect = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + '/preview/?id=' + data.id;
- previewWindow.location.href = redirect;
- });
-
-
- }
-
- };
+ function scaffoldEmpty() {
+ return contentResource.getScaffold($routeParams.id, $routeParams.doctype);
+ }
+ function scaffoldBlueprint() {
+ return contentResource.getBlueprintScaffold($routeParams.blueprintId);
+ }
+ $scope.contentId = $routeParams.id;
+ $scope.saveMethod = contentResource.save;
+ $scope.getMethod = contentResource.getById;
+ $scope.getScaffoldMethod = $routeParams.blueprintId ? scaffoldBlueprint : scaffoldEmpty;
+ $scope.page = $routeParams.page;
+ $scope.isNew = $routeParams.create;
}
angular.module("umbraco").controller("Umbraco.Editors.Content.EditController", ContentEditController);
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/content.rights.controller.js b/src/Umbraco.Web.UI.Client/src/views/content/content.rights.controller.js
new file mode 100644
index 0000000000..eace76ac75
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/content/content.rights.controller.js
@@ -0,0 +1,152 @@
+(function () {
+ "use strict";
+
+ function ContentRightsController($scope, contentResource) {
+
+ var vm = this;
+
+ vm.availableUserGroups = [];
+ vm.selectedUserGroups = [];
+ vm.removedUserGroups = [];
+ vm.viewState = "manageGroups";
+
+ vm.setViewSate = setViewSate;
+ vm.editPermissions = editPermissions;
+ vm.setPermissions = setPermissions;
+ vm.save = save;
+ vm.removePermissions = removePermissions;
+ vm.cancelManagePermissions = cancelManagePermissions;
+
+ function onInit() {
+ vm.loading = true;
+ contentResource.getDetailedPermissions($scope.currentNode.id).then(function (userGroups) {
+ initData(userGroups);
+ vm.loading = false;
+ });
+ }
+
+ /**
+ * This will initialize the data and set the correct selectedUserGroups based on the default permissions and explicit permissions assigned
+ * @param {any} userGroups
+ */
+ function initData(userGroups) {
+ //reset this
+ vm.selectedUserGroups = [];
+ vm.availableUserGroups = userGroups;
+ angular.forEach(vm.availableUserGroups, function (group) {
+ if (group.permissions) {
+ //if there's explicit permissions assigned than it's selected
+ assignGroupPermissions(group);
+ }
+ });
+ }
+
+ function setViewSate(state) {
+ vm.viewState = state;
+ }
+
+ function editPermissions(group) {
+ vm.selectedUserGroup = group;
+ if (!vm.selectedUserGroup.permissions) {
+ //if no permissions are explicitly set this means we need to show the defaults
+ vm.selectedUserGroup.permissions = vm.selectedUserGroup.defaultPermissions;
+ }
+ setViewSate("managePermissions");
+ }
+
+ function assignGroupPermissions(group) {
+ // clear allowed permissions before we make the list so we don't have duplicates
+ group.allowedPermissions = [];
+
+ // get list of checked permissions
+ angular.forEach(group.permissions, function (permissionGroup) {
+ angular.forEach(permissionGroup, function (permission) {
+ if (permission.checked) {
+ //the `allowedPermissions` is what will get sent up to the server for saving
+ group.allowedPermissions.push(permission);
+ }
+ });
+ });
+
+ if (!group.selected) {
+ // set to selected so we can remove from the dropdown easily
+ group.selected = true;
+ vm.selectedUserGroups.push(group);
+ //remove from the removed groups if it's been re-added
+ vm.removedUserGroups = _.reject(vm.removedUserGroups, function (g) {
+ return g.id == group.id;
+ });
+ }
+ }
+
+ function setPermissions(group) {
+ assignGroupPermissions(group);
+ setViewSate("manageGroups");
+ }
+
+ /**
+ * This essentially resets the permissions for a group for this content item, it will remove it from the selected list
+ * @param {any} index
+ */
+ function removePermissions(index) {
+ // remove as selected so we can select it from the dropdown again
+ var group = vm.selectedUserGroups[index];
+ group.selected = false;
+ //reset assigned permissions - so it will default back to default permissions
+ group.permissions = [];
+ group.allowedPermissions = [];
+ vm.selectedUserGroups.splice(index, 1);
+ //track it in the removed so this gets pushed to the server
+ vm.removedUserGroups.push(group);
+ }
+
+ function cancelManagePermissions() {
+ setViewSate("manageGroups");
+ }
+
+ function formatSaveModel(permissionsSave, groupCollection) {
+ angular.forEach(groupCollection, function (g) {
+ permissionsSave[g.id] = [];
+ angular.forEach(g.allowedPermissions, function (p) {
+ permissionsSave[g.id].push(p.permissionCode);
+ });
+ });
+ }
+
+ function save() {
+
+ vm.saveState = "busy";
+ vm.saveError = false;
+ vm.saveSuccces = false;
+
+ //this is a dictionary that we need to populate
+ var permissionsSave = {};
+ //format the selectedUserGroups, then the removedUserGroups since we want to pass data from both collections up
+ formatSaveModel(permissionsSave, vm.selectedUserGroups);
+ formatSaveModel(permissionsSave, vm.removedUserGroups);
+
+ var saveModel = {
+ contentId: $scope.currentNode.id,
+ permissions: permissionsSave
+ };
+
+ contentResource.savePermissions(saveModel).then(function (userGroups) {
+
+ //re-assign model from server since it could have changed
+ initData(userGroups);
+
+ vm.saveState = "success";
+ vm.saveSuccces = true;
+ }, function(error){
+ vm.saveState = "error";
+ vm.saveError = error;
+ });
+ }
+
+ onInit();
+
+ }
+
+ angular.module("umbraco").controller("Umbraco.Editors.Content.RightsController", ContentRightsController);
+
+})();
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/create.html b/src/Umbraco.Web.UI.Client/src/views/content/create.html
index 73bdc5c188..918b023329 100644
--- a/src/Umbraco.Web.UI.Client/src/views/content/create.html
+++ b/src/Umbraco.Web.UI.Client/src/views/content/create.html
@@ -1,45 +1,55 @@
-
-
-
Create a page under {{currentNode.name}}
-
-
-
+
+
Create a page under {{currentNode.name}}
+
Select a blueprint
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html b/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html
new file mode 100644
index 0000000000..bdec8c650d
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/content/createblueprint.html
@@ -0,0 +1,44 @@
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/edit.html b/src/Umbraco.Web.UI.Client/src/views/content/edit.html
index 0ef68fe07b..2ad4534115 100644
--- a/src/Umbraco.Web.UI.Client/src/views/content/edit.html
+++ b/src/Umbraco.Web.UI.Client/src/views/content/edit.html
@@ -1,86 +1,11 @@
-
-
-
-
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/content/rights.html b/src/Umbraco.Web.UI.Client/src/views/content/rights.html
new file mode 100644
index 0000000000..4bbef17faa
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/content/rights.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
{{vm.saveError.errorMsg}}
+
{{vm.saveError.data.message}}
+
+
+
+
+
+ Permissions saved for {{currentNode.name}}
+
+
+
+
Ut tempor dui nec consectetur efficitur.
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam tellus purus, malesuada sed purus ut, semper sollicitudin odio.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/delete.controller.js b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/delete.controller.js
new file mode 100644
index 0000000000..cc5e4b32a9
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/delete.controller.js
@@ -0,0 +1,32 @@
+/**
+ * @ngdoc controller
+ * @name Umbraco.Editors.ContentBlueprint.DeleteController
+ * @function
+ *
+ * @description
+ * The controller for deleting content blueprints
+ */
+function ContentBlueprintDeleteController($scope, contentResource, treeService, navigationService) {
+
+ $scope.performDelete = function() {
+
+ //mark it for deletion (used in the UI)
+ $scope.currentNode.loading = true;
+
+ contentResource.deleteBlueprint($scope.currentNode.id)
+ .then(function() {
+ $scope.currentNode.loading = false;
+ //get the root node before we remove it
+ var rootNode = treeService.getTreeRoot($scope.currentNode);
+ //TODO: Need to sync tree, etc...
+ treeService.removeNode($scope.currentNode);
+ navigationService.hideMenu();
+ });
+ };
+
+ $scope.cancel = function() {
+ navigationService.hideDialog();
+ };
+}
+
+angular.module("umbraco").controller("Umbraco.Editors.ContentBlueprint.DeleteController", ContentBlueprintDeleteController);
diff --git a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/delete.html b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/delete.html
new file mode 100644
index 0000000000..44a31254d2
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/delete.html
@@ -0,0 +1,12 @@
+
+
+
+
+ Are you sure you want to delete {{currentNode.name}} ?
+
+
+
+
+
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/edit.controller.js
new file mode 100644
index 0000000000..cb8e091e50
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/edit.controller.js
@@ -0,0 +1,34 @@
+/**
+ * @ngdoc controller
+ * @name Umbraco.Editors.Content.EditController
+ * @function
+ *
+ * @description
+ * The controller for the content editor
+ */
+function ContentBlueprintEditController($scope, $routeParams, contentResource) {
+ var excludedProps = ["_umb_urls", "_umb_releasedate", "_umb_expiredate", "_umb_template"];
+
+ function getScaffold() {
+ return contentResource.getScaffold(-1, $routeParams.doctype)
+ .then(function (scaffold) {
+ var lastTab = scaffold.tabs[scaffold.tabs.length - 1];
+ lastTab.properties = _.filter(lastTab.properties,
+ function(p) {
+ return excludedProps.indexOf(p.alias) === -1;
+ });
+ scaffold.allowPreview = false;
+ scaffold.allowedActions = ["A", "S", "C"];
+
+ return scaffold;
+ });
+ }
+
+ $scope.contentId = $routeParams.id;
+ $scope.isNew = $routeParams.id === "-1";
+ $scope.saveMethod = contentResource.saveBlueprint;
+ $scope.getMethod = contentResource.getBlueprintById;
+ $scope.getScaffoldMethod = getScaffold;
+}
+
+angular.module("umbraco").controller("Umbraco.Editors.ContentBlueprint.EditController", ContentBlueprintEditController);
diff --git a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/edit.html b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/edit.html
new file mode 100644
index 0000000000..5d27978072
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/edit.html
@@ -0,0 +1,9 @@
+
+
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html
new file mode 100644
index 0000000000..06d17350ff
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/contentblueprints/intro.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
TODO: This is a non designed placeholder for beta release - please update me!
+
+
What are Content Templates?
+
Content Templates are pre-defined content that can be selected when creating a new Content node.
+
How do I create a Content Template?
+
Simply right-click a content node and select "Create Content Template" to create a new Content Template. Once given a name, editors can start
+ using the Content Template as a foundation for their new page.
+
How do I manage Content Templates
+
You can edit and delete Content Templates from the "Content Templates" tree in the Settings section. Just expand the Document Type which the
+ Content Template is based on and click it to edit or delete it.
+
+
+
+
+
+
+
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/dashboard.tabs.controller.js b/src/Umbraco.Web.UI.Client/src/views/dashboard/dashboard.tabs.controller.js
index 9b7c929367..d0823d1815 100644
--- a/src/Umbraco.Web.UI.Client/src/views/dashboard/dashboard.tabs.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/dashboard.tabs.controller.js
@@ -278,8 +278,8 @@ function MediaFolderBrowserDashboardController($rootScope, $scope, $location, co
currentUser = user;
- // check if the user start node is the dashboard
- if(currentUser.startMediaId === -1) {
+ // check if the user has access to the root which they will require to see this dashboard
+ if (currentUser.startMediaIds.indexOf(-1) >= 0) {
//get the system media listview
contentTypeResource.getPropertyTypeScaffold(-96)
@@ -303,9 +303,9 @@ function MediaFolderBrowserDashboardController($rootScope, $scope, $location, co
});
- } else {
+ } else if (currentUser.startMediaIds.length > 0){
// redirect to start node
- $location.path("/media/media/edit/" + currentUser.startMediaId);
+ $location.path("/media/media/edit/" + (currentUser.startMediaIds.length === 0 ? -1 : currentUser.startMediaIds[0]));
}
});
diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardintro.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardintro.html
index 6ced082c06..9b7f1433e3 100644
--- a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardintro.html
+++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardintro.html
@@ -10,5 +10,5 @@
Find an add-on package to help you get going quickly
Watch our tutorial videos (some are free, some require a subscription)
Find out about our productivity boosting tools and commercial support
-
Find out about real-life training and certification opportunities
+
Find out about real-life training and certification opportunities
diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html
index 3a45776872..d59d10d393 100644
--- a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html
+++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html
@@ -10,5 +10,5 @@
Ask a question in the Community Forum
Watch our tutorial videos (some are free, some require a subscription)
Find out about our productivity boosting tools and commercial support
-
Find out about real-life training and certification opportunities
+
Find out about real-life training and certification opportunities
diff --git a/src/Umbraco.Web.UI.Client/src/views/datatypes/delete.html b/src/Umbraco.Web.UI.Client/src/views/datatypes/delete.html
index fe75a54982..debd3ccb8c 100644
--- a/src/Umbraco.Web.UI.Client/src/views/datatypes/delete.html
+++ b/src/Umbraco.Web.UI.Client/src/views/datatypes/delete.html
@@ -14,15 +14,15 @@
diff --git a/src/Umbraco.Web.UI.Client/src/views/datatypes/move.html b/src/Umbraco.Web.UI.Client/src/views/datatypes/move.html
index 9725c7ec5f..09390cdb81 100644
--- a/src/Umbraco.Web.UI.Client/src/views/datatypes/move.html
+++ b/src/Umbraco.Web.UI.Client/src/views/datatypes/move.html
@@ -4,7 +4,7 @@
- Select the folder to move {{currentNode.name}} to in the tree structure below
+ Select the folder to move {{currentNode.name}} to in the tree structure below
@@ -17,7 +17,7 @@
-
{{currentNode.name}} was moved underneath {{target.name}}
+ {{currentNode.name}} was moved underneath {{target.name}}
diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.html
index 39efb9d1c6..1c480b9766 100644
--- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.html
+++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.html
@@ -9,6 +9,7 @@
diff --git a/src/Umbraco.Web.UI.Client/src/views/media/move.html b/src/Umbraco.Web.UI.Client/src/views/media/move.html
index 2a56e3de3c..52be1832f0 100644
--- a/src/Umbraco.Web.UI.Client/src/views/media/move.html
+++ b/src/Umbraco.Web.UI.Client/src/views/media/move.html
@@ -50,7 +50,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/member/create.html b/src/Umbraco.Web.UI.Client/src/views/member/create.html
index 2ef2b5f04f..188c6214eb 100644
--- a/src/Umbraco.Web.UI.Client/src/views/member/create.html
+++ b/src/Umbraco.Web.UI.Client/src/views/member/create.html
@@ -20,7 +20,7 @@
diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.controller.js
index 9ce2506e76..8be7d1b17a 100644
--- a/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.controller.js
@@ -1,7 +1,7 @@
(function () {
"use strict";
- function PackagesInstallLocalController($scope, $route, $location, Upload, umbRequestHelper, packageResource, localStorageService, $timeout, $window, localizationService) {
+ function PackagesInstallLocalController($scope, $route, $location, Upload, umbRequestHelper, packageResource, localStorageService, $timeout, $window, localizationService, $q) {
var vm = this;
vm.state = "upload";
@@ -68,6 +68,7 @@
// set done status on file
vm.zipFile.uploadStatus = "done";
loadPackage();
+ vm.zipFile.uploadProgress = 100;
vm.localPackage = data;
}
@@ -96,7 +97,7 @@
}
} else if (evt.Message) {
- file.serverErrorMessage = evt.Message;
+ vm.zipFile.serverErrorMessage = evt.Message;
}
}
});
@@ -117,10 +118,37 @@
.then(function(pack) {
vm.installState.progress = "25";
vm.installState.status = localizationService.localize("packager_installStateInstalling");
- vm.installState.progress = "50";
return packageResource.installFiles(pack);
},
installError)
+ .then(function(pack) {
+ vm.installState.status = localizationService.localize("packager_installStateRestarting");
+ vm.installState.progress = "50";
+ var deferred = $q.defer();
+
+ //check if the app domain is restarted ever 2 seconds
+ var count = 0;
+ function checkRestart() {
+ $timeout(function () {
+ packageResource.checkRestart(pack).then(function (d) {
+ count++;
+ //if there is an id it means it's not restarted yet but we'll limit it to only check 10 times
+ if (d.isRestarting && count < 10) {
+ checkRestart();
+ }
+ else {
+ //it's restarted!
+ deferred.resolve(d);
+ }
+ },
+ installError);
+ }, 2000);
+ }
+
+ checkRestart();
+
+ return deferred.promise;
+ }, installError)
.then(function(pack) {
vm.installState.status = localizationService.localize("packager_installStateRestarting");
vm.installState.progress = "75";
diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html
index 1ef87baf83..f548a29308 100644
--- a/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html
+++ b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html
@@ -24,7 +24,7 @@