Don't show (blank) for non blueprint content types (#3887)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
e41db72ef7
commit
9af6e3027f
@@ -605,13 +605,17 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie
|
||||
|
||||
//$scope.listViewAllowedTypes = getContentTypesCallback(id);
|
||||
getContentTypesCallback(id).then(function (listViewAllowedTypes) {
|
||||
var blueprints = false;
|
||||
$scope.listViewAllowedTypes = listViewAllowedTypes;
|
||||
|
||||
angular.forEach(listViewAllowedTypes, function (allowedType) {
|
||||
angular.forEach(allowedType.blueprints, function (value, key) {
|
||||
var blueprints = false;
|
||||
_.each(listViewAllowedTypes, function (allowedType) {
|
||||
if (_.isEmpty(allowedType.blueprints)) {
|
||||
// this helps the view understand that there are no blueprints available
|
||||
allowedType.blueprints = null;
|
||||
}
|
||||
else {
|
||||
blueprints = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (listViewAllowedTypes.length === 1 && blueprints === false) {
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<li ng-repeat="contentType in listViewAllowedTypes | orderBy:'name':false">
|
||||
<a href="" ng-click="createBlank(entityType,contentType.alias)" prevent-default>
|
||||
<i class="{{contentType.icon}}"></i>
|
||||
{{contentType.name}} <span ng-show="contentType.blueprints && contentType.blueprints.length != 0" style="text-transform: lowercase;">(<localize key="blueprints_blankBlueprint">blank</localize>)</span>
|
||||
{{contentType.name}} <span ng-show="contentType.blueprints" style="text-transform: lowercase;">(<localize key="blueprints_blankBlueprint">blank</localize>)</span>
|
||||
</a>
|
||||
<a href="" ng-repeat="(key, value) in contentType.blueprints" ng-click="createFromBlueprint(entityType,contentType.alias , key)" prevent-default>
|
||||
<i class="{{contentType.icon}}"></i>
|
||||
|
||||
Reference in New Issue
Block a user