folders are more or less working.

This commit is contained in:
Shannon
2015-06-08 18:22:43 +02:00
parent f36574fef3
commit 4e4382ff90
5 changed files with 21 additions and 7 deletions

View File

@@ -39,7 +39,7 @@ function memberTypeResource($q, $http, umbRequestHelper) {
'Failed to retrieve content type');
},
getEmpty: function () {
getScaffold: function () {
return umbRequestHelper.resourcePromise(
$http.get(

View File

@@ -35,7 +35,7 @@
val-form-manager>
<umb-control-group label="Enter a folder name" hide-label="false">
<input type="text" name="folderName" ng-model="model.folderName" class="umb-textstring textstring input-block-level" required />
<input type="text" name="folderName" ng-model="model.folderName" class="umb-textstring textstring input-block-level" required />
</umb-control-group>
<button type="submit" class="btn btn-primary"><localize key="general_create">Create</localize></button>

View File

@@ -27,7 +27,11 @@ function contentCreateController($scope, $location, navigationService, contentTy
var currPath = node.path ? node.path : "-1";
navigationService.syncTree({ tree: "documenttype", path: currPath + "," + folderId, forceReload: true, activate: true });
$location.path("/documenttype/list/" + folderId);
formHelper.resetForm({ scope: $scope });
var section = appState.getSectionState("currentSection");
$location.path("/" + section + "/documenttype/list/" + folderId);
}, function(err) {

View File

@@ -53,7 +53,7 @@ function DocumentTypeEditController($scope, $rootScope, $routeParams, $log, cont
if ($routeParams.create) {
//we are creating so get an empty data type item
contentTypeResource.getEmpty()
contentTypeResource.getScaffold()
.then(function(dt) {
init(dt);
});

View File

@@ -31,13 +31,23 @@ namespace Umbraco.Web.Trees
nodes.AddRange(
Services.EntityService.GetChildren(intId.Result, UmbracoObjectTypes.DocumentTypeContainer)
.OrderBy(entity => entity.Name)
.Select(dt => CreateTreeNode(dt.Id.ToString(), id, queryStrings, dt.Name, "icon-folder", dt.HasChildren(),
queryStrings.GetValue<string>("application") + TreeAlias.EnsureStartsWith('/') + "/list/" + dt.Id)));
.Select(dt =>
{
var node = CreateTreeNode(dt.Id.ToString(), id, queryStrings, dt.Name, "icon-folder", dt.HasChildren(),
queryStrings.GetValue<string>("application") + TreeAlias.EnsureStartsWith('/') + "/list/" + dt.Id);
node.Path = dt.Path;
return node;
}));
nodes.AddRange(
Services.EntityService.GetChildren(intId.Result, UmbracoObjectTypes.DocumentType)
.OrderBy(entity => entity.Name)
.Select(dt => CreateTreeNode(dt.Id.ToString(), id, queryStrings, dt.Name, "icon-item-arrangement", false)));
.Select(dt =>
{
var node = CreateTreeNode(dt.Id.ToString(), id, queryStrings, dt.Name, "icon-item-arrangement", false);
node.Path = dt.Path;
return node;
}));
return nodes;
}