diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/codefile.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/codefile.resource.js index 4655b6fa3b..b6e35d9d7b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/codefile.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/codefile.resource.js @@ -127,13 +127,13 @@ function codefileResource($q, $http, umbDataFormatter, umbRequestHelper) { * * *
- * codefileResource.deleteByPath('partialView', 'Grid%2fEditors%2fBase.cshtml')
+ * codefileResource.deleteByPath('partialViews', 'Grid%2fEditors%2fBase.cshtml')
* .then(function() {
* alert('its gone!');
* });
*
*
- * @param {type} the type of script (partialView, partialViewMacro, script)
+ * @param {type} the type of script (partialViews, partialViewMacros, scripts)
* @param {virtualpath} the virtual path of the script
* @returns {Promise} resourcePromise object.
*
@@ -145,7 +145,7 @@ function codefileResource($q, $http, umbDataFormatter, umbRequestHelper) {
"codeFileApiBaseUrl",
"Delete",
[{ type: type }, { virtualPath: virtualpath}])),
- "Failed to delete item " + id);
+ "Failed to delete item: " + virtualpath);
},
/**
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/membertype.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/membertype.resource.js
index 0649277c54..6c83f69f84 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/membertype.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/membertype.resource.js
@@ -19,14 +19,14 @@ function memberTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
_.each(filterContentTypes, function (item) {
query += "filterContentTypes=" + item + "&";
});
- // if filterContentTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
+ // if filterContentTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
if (filterContentTypes.length === 0) {
query += "filterContentTypes=&";
}
_.each(filterPropertyTypes, function (item) {
query += "filterPropertyTypes=" + item + "&";
});
- // if filterPropertyTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
+ // if filterPropertyTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
if (filterPropertyTypes.length === 0) {
query += "filterPropertyTypes=&";
}
diff --git a/src/Umbraco.Web.UI.Client/src/views/membertypes/delete.controller.js b/src/Umbraco.Web.UI.Client/src/views/membertypes/delete.controller.js
index 061ca7eb2c..c0cd0c8598 100644
--- a/src/Umbraco.Web.UI.Client/src/views/membertypes/delete.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/membertypes/delete.controller.js
@@ -1,10 +1,10 @@
/**
* @ngdoc controller
- * @name Umbraco.Editors.DocumentType.DeleteController
+ * @name Umbraco.Editors.MemberTypes.DeleteController
* @function
*
* @description
- * The controller for deleting content
+ * The controller for deleting member types
*/
function MemberTypesDeleteController($scope, memberTypeResource, treeService, navigationService) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.controller.js
new file mode 100644
index 0000000000..9789467827
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.controller.js
@@ -0,0 +1,34 @@
+/**
+ * @ngdoc controller
+ * @name Umbraco.Editors.PartialViewMacros.DeleteController
+ * @function
+ *
+ * @description
+ * The controller for deleting partial view macros
+ */
+function PartialViewMacrosDeleteController($scope, codefileResource, treeService, navigationService) {
+
+ $scope.performDelete = function() {
+
+ //mark it for deletion (used in the UI)
+ $scope.currentNode.loading = true;
+
+ var virtualPath = $scope.currentNode.parentId + $scope.currentNode.name;
+
+ codefileResource.deleteByPath('partialViewMacros', virtualPath)
+ .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.PartialViewMacros.DeleteController", PartialViewMacrosDeleteController);
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.html b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.html
new file mode 100644
index 0000000000..6b66a48821
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/delete.html
@@ -0,0 +1,12 @@
+
+
+
+