V8: It should be possible to disallow all types at content root (#6580)

This commit is contained in:
Kenn Jacobsen
2019-10-15 17:57:06 +02:00
committed by Sebastiaan Janssen
parent 178185e411
commit 8a85c3cbf9
6 changed files with 18 additions and 15 deletions

View File

@@ -22,7 +22,8 @@ function contentCreateController($scope,
function initialize() {
$scope.loading = true;
$scope.allowedTypes = null;
$scope.countTypes = contentTypeResource.getCount;
var getAllowedTypes = contentTypeResource.getAllowedTypes($scope.currentNode.id).then(function (data) {
$scope.allowedTypes = iconHelper.formatContentTypeIcons(data);
});
@@ -97,7 +98,7 @@ function contentCreateController($scope,
$scope.close = function() {
close();
}
};
$scope.closeDialog = function (showMenu) {
navigationService.hideDialog(showMenu);
@@ -106,12 +107,12 @@ function contentCreateController($scope,
$scope.createContentType = function () {
$location.path("/settings/documenttypes/edit/-1").search("create", "true");
close();
}
};
$scope.editContentType = function () {
$location.path("/settings/documenttypes/edit/" + $scope.contentTypeId).search("view", "permissions");
close();
}
};
$scope.createBlank = createBlank;
$scope.createOrSelectBlueprintIfAny = createOrSelectBlueprintIfAny;

View File

@@ -19,10 +19,16 @@
</button>
</div>
<div ng-if="hasSettingsAccess && currentNode.id < 0">
<p class="abstract">
<!-- There are existing document types, but none are allowed at root -->
<p class="abstract" ng-if="countTypes > 0">
<localize key="create_noDocumentTypesAllowedAtRoot" />
</p>
<!-- There's no document types, help people create one -->
<p class="abstract" ng-if="countTypes === 0">
<localize key="create_noDocumentTypesAtRoot" />
</p>
<button class="btn umb-outline" ng-click="createContentType()">
<button class="btn umb-outline" ng-click="createContentType()" ng-if="countTypes === 0">
<localize key="create_noDocumentTypesCreateNew" />
</button>
</div>