ds4/src/templates/actor/partials/talents-abilities-overview.hbs

71 lines
3.2 KiB
Handlebars
Raw Normal View History

{{!-- TODO: Refactor to avoid code duplication with creature-special-abilities-overview and talents-overview --}}
{{!-- ======================================================================== --}}
{{!-- INLINE PARTIAL DEFINITIONS --}}
{{!-- ======================================================================== --}}
{{!--
!-- 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}}
{{/if}}
2021-01-23 23:44:49 +01:00
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
{{/inline}}
{{!-- ======================================================================== --}}
<div class="tab talents-abilities" data-group="primary" data-tab="talents-abilities">
2021-02-25 22:22:05 +01:00
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeTalentPlural'}}</h4>
{{#> ifHasItemOfType itemsArray=itemsByType.talent dataType='talent'}}
2021-02-25 22:22:05 +01:00
<ol class="ds4-item-list ds4-item-list--talent item-list">
{{#> systems/ds4/templates/actor/partials/item-list-header.hbs}}
{{!-- rank --}}
<div>{{localize 'DS4.TalentRank'}}</div>
{{/systems/ds4/templates/actor/partials/item-list-header.hbs}}
{{#each itemsByType.talent as |itemData id|}}
{{#> systems/ds4/templates/actor/partials/item-list-entry.hbs itemData=itemData}}
{{!-- rank --}}
{{> systems/ds4/templates/actor/partials/talent-rank-equation.hbs talentRank=itemData.data.rank}}
{{/systems/ds4/templates/actor/partials/item-list-entry.hbs}}
2021-01-07 20:20:40 +01:00
{{/each}}
</ol>
{{/ifHasItemOfType}}
2021-01-07 20:20:40 +01:00
2021-02-25 22:22:05 +01:00
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeRacialAbilityPlural'}}</h4>
{{#> ifHasItemOfType itemsArray=itemsByType.racialAbility dataType='racialAbility'}}
2021-02-25 22:22:05 +01:00
<ol class="ds4-item-list ds4-item-list--racial-ability item-list">
{{> systems/ds4/templates/actor/partials/item-list-header.hbs}}
{{#each itemsByType.racialAbility as |itemData id|}}
{{> systems/ds4/templates/actor/partials/item-list-entry.hbs itemData=itemData}}
{{/each}}
</ol>
{{/ifHasItemOfType}}
2021-02-25 22:22:05 +01:00
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeLanguagePlural'}}</h4>
{{#> ifHasItemOfType itemsArray=itemsByType.language dataType='language'}}
2021-02-25 22:22:05 +01:00
<ol class="ds4-item-list ds4-item-list--language item-list">
{{> systems/ds4/templates/actor/partials/item-list-header.hbs}}
{{#each itemsByType.language as |itemData id|}}
{{> systems/ds4/templates/actor/partials/item-list-entry.hbs itemData=itemData}}
{{/each}}
</ol>
{{/ifHasItemOfType}}
2021-02-25 22:22:05 +01:00
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeAlphabetPlural'}}</h4>
{{#> ifHasItemOfType itemsArray=itemsByType.alphabet dataType='alphabet'}}
2021-02-25 22:22:05 +01:00
<ol class="ds4-item-list ds4-item-list--alphabet item-list">
{{> systems/ds4/templates/actor/partials/item-list-header.hbs}}
{{#each itemsByType.alphabet as |itemData id|}}
{{> systems/ds4/templates/actor/partials/item-list-entry.hbs itemData=itemData}}
{{/each}}
</ol>
{{/ifHasItemOfType}}
</div>