Added button to create only available doctype

Hides dropdown when listViewAllowedTypes.length > 1
Shows button for single when listViewAllowedTypes.length === 1
This commit is contained in:
Lars-Erik Aabech
2016-05-11 21:44:22 +02:00
parent fcaa4ad8d6
commit 597b4c3dd2

View File

@@ -11,7 +11,7 @@
<umb-editor-sub-header-content-left>
<umb-editor-sub-header-section ng-if="(listViewAllowedTypes && listViewAllowedTypes.length > 0 && !isAnythingSelected()) && currentNodePermissions.canCreate">
<div class="btn-group">
<div class="btn-group" ng-show="listViewAllowedTypes.length > 1">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<localize key="actions_create">Create</localize>
<span class="caret"></span>
@@ -25,6 +25,12 @@
</li>
</ul>
</div>
<div class="btn-group" ng-show="listViewAllowedTypes.length === 1">
<a class="btn" href="#/{{entityType}}/{{entityType}}/edit/{{contentId}}?doctype={{listViewAllowedTypes[0].alias}}&create=true">
<i class="icon-{{listViewAllowedTypes[0].cssClass}}"></i>
<localize key="actions_create">Create</localize> {{ listViewAllowedTypes[0].name }}
</a>
</div>
</umb-editor-sub-header-section>
<umb-editor-sub-header-section ng-if="isAnythingSelected()">