Deleting works, wired up some validation for duplicate names
This commit is contained in:
@@ -230,7 +230,8 @@
|
||||
templateUrl: 'views/components/content/edit.html',
|
||||
scope: {
|
||||
contentId: "=",
|
||||
createOptions: "="
|
||||
createOptions: "=?",
|
||||
page: "=?"
|
||||
},
|
||||
link: link
|
||||
};
|
||||
|
||||
@@ -269,6 +269,16 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
'Failed to delete item ' + id);
|
||||
},
|
||||
|
||||
deleteBlueprint: function (id) {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.post(
|
||||
umbRequestHelper.getApiUrl(
|
||||
"contentApiBaseUrl",
|
||||
"DeleteBlueprint",
|
||||
[{ id: id }])),
|
||||
'Failed to delete blueprint ' + id);
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name umbraco.resources.contentResource#getById
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
function ContentEditController($scope, $routeParams) {
|
||||
|
||||
$scope.contentId = $routeParams.id;
|
||||
$scope.page = $routeParams.page;
|
||||
$scope.createOptions = null;
|
||||
if ($routeParams.create && $routeParams.doctype) {
|
||||
$scope.createOptions = {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<div ng-controller="Umbraco.Editors.Content.EditController">
|
||||
<content-editor create-options="createOptions"
|
||||
content-id="contentId">
|
||||
content-id="contentId"
|
||||
page="page">
|
||||
</content-editor>
|
||||
</div>
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
* @description
|
||||
* The controller for deleting content blueprints
|
||||
*/
|
||||
function ContentBlueprintDeleteController($scope, codefileResource, treeService, navigationService) {
|
||||
function ContentBlueprintDeleteController($scope, contentResource, treeService, navigationService) {
|
||||
|
||||
$scope.performDelete = function() {
|
||||
|
||||
//mark it for deletion (used in the UI)
|
||||
$scope.currentNode.loading = true;
|
||||
|
||||
codefileResource.deleteByPath('partialViews', $scope.currentNode.id)
|
||||
contentResource.deleteBlueprint($scope.currentNode.id)
|
||||
.then(function() {
|
||||
$scope.currentNode.loading = false;
|
||||
//get the root node before we remove it
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @ngdoc controller
|
||||
* @name Umbraco.Editors.Content.EditController
|
||||
* @function
|
||||
*
|
||||
* @description
|
||||
* The controller for the content editor
|
||||
*/
|
||||
function ContentBlueprintEditController($scope, $routeParams) {
|
||||
$scope.contentId = $routeParams.id;
|
||||
}
|
||||
|
||||
angular.module("umbraco").controller("Umbraco.Editors.ContentBlueprint.EditController", ContentEditController);
|
||||
@@ -1,3 +1,4 @@
|
||||
<div>
|
||||
<content-editor></content-editor>
|
||||
<div ng-controller="Umbraco.Editors.ContentBlueprint.EditController">
|
||||
<content-editor content-id="contentId">
|
||||
</content-editor>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user