@@ -143,9 +167,11 @@
{{/itemListEntry}}
{{/each}}
+ {{/ifHasItemOfType}}
{{!-- TRINKET --}}
{{localize 'DS4.ItemTypeTrinketPlural'}}
+ {{#> ifHasItemOfType itemsArray=itemsByType.trinket dataType='trinket' }}
{{#> itemListHeader dataType='trinket'}}
{{localize 'DS4.StorageLocation'}}
@@ -157,9 +183,11 @@
{{/itemListEntry}}
{{/each}}
+ {{/ifHasItemOfType}}
{{!-- EQUIPMENT --}}
{{localize 'DS4.ItemTypeEquipmentPlural'}}
+ {{#> ifHasItemOfType itemsArray=itemsByType.equipment dataType='equipment' }}
{{#> itemListHeader dataType='equipment'}}
{{localize 'DS4.StorageLocation'}}
@@ -171,4 +199,5 @@
{{/itemListEntry}}
{{/each}}
+ {{/ifHasItemOfType}}
\ No newline at end of file
diff --git a/src/templates/actor/partials/talents-overview.hbs b/src/templates/actor/partials/talents-overview.hbs
index 7aa194e5..f4a06005 100644
--- a/src/templates/actor/partials/talents-overview.hbs
+++ b/src/templates/actor/partials/talents-overview.hbs
@@ -4,6 +4,23 @@
{{!-- TODO: remove duplicate add and delete button definition --}}
+
+{{!--
+!-- Render the given partial block only if the given itemsArray has length > 0,
+!-- else only an add button.
+!--
+!-- @param itemsArray: the array with the items to check the length of
+!-- @param dataType: the string type of the item
+--}}
+{{#*inline "ifHasItemOfType"}}
+{{#if (and (ne itemsArray undefined) (gt itemsArray.length 0))}}
+ {{> @partial-block}}
+{{else}}
+ {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
+{{/if}}
+{{/inline}}
+
+
{{!--
!-- Render an input element for a rank value property of an item.
!--
@@ -105,6 +122,7 @@
{{localize 'DS4.ItemTypeTalentPlural'}}
+ {{#> ifHasItemOfType itemsArray=itemsByType.talent dataType='talent' }}
+ {{/ifHasItemOfType}}
{{localize 'DS4.ItemTypeRacialAbilityPlural'}}
+ {{#> ifHasItemOfType itemsArray=itemsByType.racialAbility dataType='racialAbility' }}
{{> baseItemListHeader dataType='racialAbility' }}
{{#each itemsByType.racialAbility as |item id|}}
{{> baseItemListEntry item=item}}
{{/each}}
+ {{/ifHasItemOfType}}
{{localize 'DS4.ItemTypeLanguagePlural'}}
+ {{#> ifHasItemOfType itemsArray=itemsByType.language dataType='language' }}
{{> baseItemListHeader dataType='language' }}
{{#each itemsByType.language as |item id|}}
{{> baseItemListEntry item=item}}
{{/each}}
+ {{/ifHasItemOfType}}
{{localize 'DS4.ItemTypeAlphabetPlural'}}
+ {{#> ifHasItemOfType itemsArray=itemsByType.alphabet dataType='alphabet' }}
{{> baseItemListHeader dataType='alphabet' }}
{{#each itemsByType.alphabet as |item id|}}
{{> baseItemListEntry item=item}}
{{/each}}
+ {{/ifHasItemOfType}}
\ No newline at end of file