feat: implement clean Foundry V13 compliant tab system

- Remove custom tab implementation in favor of official ApplicationV2 tabs
- Implement ApplicationTab typedef structure for Actor and Item sheets
- Add memory-safe event listener management with proper cleanup
- Update all sheet templates to use standard Foundry tab structure
- Add template safety checks to prevent undefined access errors
- Optimize performance with DOM updates instead of full re-renders
- Maintain backward CSS compatibility during transition
- Add dynamic tab configuration based on item types

Key improvements:
- ~200 lines of custom tab code removed
- Memory leak prevention with proper event cleanup
- Performance optimization (no re-render on tab switch)
- Standards-compliant with Foundry V13 ApplicationV2 API
- Consistent implementation across Actor and Item sheets
- Template safety with Handlebars guards
- Dynamic icon and localization support

All 31 modified files now use the official Foundry VTT v13 tab system.
This commit is contained in:
Alexander Minges 2025-07-29 19:03:58 +02:00
parent 2c4dbb2620
commit 40e14d1196
Signed by: Athemis
GPG key ID: 31FBDEF92DDB162B
31 changed files with 653 additions and 379 deletions

View file

@ -13,38 +13,47 @@ SPDX-License-Identifier: MIT
{{/systems/ds4/templates/sheets/actor/components/actor-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="values">{{localize 'DS4.HeadingValues'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="inventory">{{localize 'DS4.HeadingInventory'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="spells">{{localize 'DS4.HeadingSpells'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="abilities">{{localize 'DS4.HeadingAbilities'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="biography">{{localize 'DS4.HeadingBiography'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
<!-- beautify ignore:start -->
<!-- prettier-ignore-start -->
{{!-- Sheet Body (remove indentation to avoid annoying Handlebars auto-indent) --}}
<section class="ds4-sheet-body">
{{!-- Values Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/values.hbs}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Values Tab --}}
<div class="tab {{#if tabs.values}}{{tabs.values.cssClass}}{{/if}}" data-tab="values" data-group="primary">
{{> systems/ds4/templates/sheets/actor/components/core-values.hbs}}
{{> systems/ds4/templates/sheets/actor/components/combat-values.hbs}}
{{> systems/ds4/templates/sheets/actor/components/checks.hbs}}
</div>
{{!-- Inventory Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/character-inventory.hbs}}
{{!-- Inventory Tab --}}
<div class="tab {{#if tabs.inventory}}{{tabs.inventory.cssClass}}{{/if}}" data-tab="inventory" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/character-inventory.hbs}}
</div>
{{!-- Spells Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/spells.hbs}}
{{!-- Spells Tab --}}
<div class="tab {{#if tabs.spells}}{{tabs.spells.cssClass}}{{/if}}" data-tab="spells" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/spells.hbs}}
</div>
{{!-- Abilities Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/character-abilities.hbs}}
{{!-- Abilities Tab --}}
<div class="tab {{#if tabs.abilities}}{{tabs.abilities.cssClass}}{{/if}}" data-tab="abilities" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/character-abilities.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/effects.hbs}}
{{!-- Effects Tab --}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/effects.hbs}}
</div>
{{!-- Biography Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/biography.hbs}}
</section>
<!-- prettier-ignore-end -->
<!-- beautify ignore:end -->
{{!-- Biography Tab --}}
<div class="tab {{#if tabs.biography}}{{tabs.biography.cssClass}}{{/if}}" data-tab="biography" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/biography.hbs}}
</div>
</section>
</form>

View file

@ -13,33 +13,45 @@ SPDX-License-Identifier: MIT
{{/systems/ds4/templates/sheets/actor/components/actor-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="values">{{localize 'DS4.HeadingValues'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="inventory">{{localize 'DS4.HeadingInventory'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="spells">{{localize 'DS4.HeadingSpells'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="abilities">{{localize 'DS4.HeadingAbilities'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Values Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/values.hbs}}
<div class="tab {{#if tabs.values}}{{tabs.values.cssClass}}{{/if}}" data-tab="values" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/values.hbs}}
</div>
{{!-- Inventory Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/creature-inventory.hbs}}
<div class="tab {{#if tabs.inventory}}{{tabs.inventory.cssClass}}{{/if}}" data-tab="inventory" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/creature-inventory.hbs}}
</div>
{{!-- Spells Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/spells.hbs}}
<div class="tab {{#if tabs.spells}}{{tabs.spells.cssClass}}{{/if}}" data-tab="spells" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/spells.hbs}}
</div>
{{!-- Abilities Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/creature-abilities.hbs}}
<div class="tab {{#if tabs.abilities}}{{tabs.abilities.cssClass}}{{/if}}" data-tab="abilities" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/creature-abilities.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/effects.hbs}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/effects.hbs}}
</div>
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/actor/tabs/description.hbs}}
<div class="tab {{#if tabs.description}}{{tabs.description.cssClass}}{{/if}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/actor/tabs/description.hbs}}
</div>
</section>
</form>

View file

@ -4,14 +4,12 @@ SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab biography" data-group="primary" data-tab="biography">
<div class="ds4-biography-tab-content">
<!-- beautify ignore:start -->
<!-- prettier-ignore-start -->
{{!-- remove indentation to avoid annoying Handlebars auto-indent --}}
<div class="ds4-biography-tab-content">
<!-- beautify ignore:start -->
<!-- prettier-ignore-start -->
{{!-- remove indentation to avoid annoying Handlebars auto-indent --}}
{{> systems/ds4/templates/sheets/actor/components/profile.hbs}}
{{> systems/ds4/templates/sheets/actor/components/biography.hbs}}
<!-- beautify ignore:end -->
<!-- prettier-ignore-end -->
</div>
<!-- beautify ignore:end -->
<!-- prettier-ignore-end -->
</div>

View file

@ -5,7 +5,7 @@ SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab abilities" data-group="primary" data-tab="abilities">
{{!-- TALENT --}}
<h4 class="ds4-embedded-document-list-title">{{localize 'DS4.ItemTypeTalentPlural'}}</h4>
{{#unless (isEmpty itemsByType.talent)}}
@ -64,4 +64,3 @@ SPDX-License-Identifier: MIT
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
documentType='item' type='alphabet'}}
</div>

View file

@ -5,7 +5,5 @@ SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab inventory" data-group="primary" data-tab="inventory">
{{> systems/ds4/templates/sheets/actor/components/currency.hbs}}
{{> systems/ds4/templates/sheets/actor/components/items-overview.hbs}}
</div>
{{> systems/ds4/templates/sheets/actor/components/currency.hbs}}
{{> systems/ds4/templates/sheets/actor/components/items-overview.hbs}}

View file

@ -5,15 +5,13 @@ SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab abilities" data-group="primary" data-tab="abilities">
{{#unless (isEmpty itemsByType.specialCreatureAbility)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--special-creature-ability item-list">
{{> systems/ds4/templates/sheets/actor/components/item-list-header.hbs type='specialCreatureAbility'}}
{{#each itemsByType.specialCreatureAbility as |item id|}}
{{> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs item=item}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
documentType='item' type='specialCreatureAbility'}}
</div>
{{#unless (isEmpty itemsByType.specialCreatureAbility)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--special-creature-ability item-list">
{{> systems/ds4/templates/sheets/actor/components/item-list-header.hbs type='specialCreatureAbility'}}
{{#each itemsByType.specialCreatureAbility as |item id|}}
{{> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs item=item}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
documentType='item' type='specialCreatureAbility'}}

View file

@ -5,6 +5,4 @@ SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab inventory" data-group="primary" data-tab="inventory">
{{> systems/ds4/templates/sheets/actor/components/items-overview.hbs}}
</div>
{{> systems/ds4/templates/sheets/actor/components/items-overview.hbs}}

View file

@ -4,6 +4,4 @@ SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab description" data-group="primary" data-tab="description">
{{> systems/ds4/templates/sheets/actor/components/description.hbs}}
</div>
{{> systems/ds4/templates/sheets/actor/components/description.hbs}}

View file

@ -5,15 +5,13 @@ SPDX-FileCopyrightText: 2021 Gesina Schwalbe
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab effects" data-group="primary" data-tab="effects">
{{#unless (isEmpty enrichedEffects)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--effect effect-list">
{{> systems/ds4/templates/sheets/actor/components/effect-list-header.hbs}}
{{#each enrichedEffects as |effectData id| }}
{{> systems/ds4/templates/sheets/actor/components/effect-list-entry.hbs effectData=effectData}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddEffectTitle'
documentType='effect'}}
</div>
{{#unless (isEmpty enrichedEffects)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--effect effect-list">
{{> systems/ds4/templates/sheets/actor/components/effect-list-header.hbs}}
{{#each enrichedEffects as |effectData id| }}
{{> systems/ds4/templates/sheets/actor/components/effect-list-entry.hbs effectData=effectData}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddEffectTitle'
documentType='effect'}}

View file

@ -42,7 +42,7 @@ titleKey=titleKey}}
{{!-- ======================================================================== --}}
<div class="ds4-sheet-tab tab spells" data-group="primary" data-tab="spells">
{{#unless (isEmpty itemsByType.spell)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--spell item-list">
{{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs isEquipable=true hideDescription=true
@ -79,6 +79,7 @@ titleKey=titleKey}}
'')}}{{item.system.spellModifier.numerical}}{{else}}{{item.system.spellModifier.complex}}{{/if}}
</div>
{{!-- max. distance --}}
{{> distanceUnit titleKey='DS4.SpellDistance' unitDatum=item.system.maxDistance
config=@root/config}}
@ -96,4 +97,3 @@ titleKey=titleKey}}
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
documentType='item' type='spell'}}
</div>

View file

@ -4,8 +4,6 @@ SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab values" data-group="primary" data-tab="values">
{{> systems/ds4/templates/sheets/actor/components/core-values.hbs}}
{{> systems/ds4/templates/sheets/actor/components/combat-values.hbs}}
{{> systems/ds4/templates/sheets/actor/components/checks.hbs}}
</div>
{{> systems/ds4/templates/sheets/actor/components/core-values.hbs}}
{{> systems/ds4/templates/sheets/actor/components/combat-values.hbs}}
{{> systems/ds4/templates/sheets/actor/components/checks.hbs}}

View file

@ -9,17 +9,25 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{tabs.description.cssClass}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{tabs.effects.cssClass}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>

View file

@ -9,28 +9,35 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="properties">{{localize 'DS4.HeadingProperties'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{#if tabs.description}}{{tabs.description.cssClass}}{{/if}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Properties Tab --}}
{{#> systems/ds4/templates/sheets/item/tabs/properties.hbs}}
{{> systems/ds4/templates/sheets/item/components/properties/armor.hbs}}
{{> systems/ds4/templates/sheets/item/components/properties/protective.hbs}}
{{#if isOwned}}
{{> systems/ds4/templates/sheets/item/components/properties/equipable.hbs}}
{{/if}}
{{> systems/ds4/templates/sheets/item/components/properties/physical.hbs}}
{{/systems/ds4/templates/sheets/item/tabs/properties.hbs}}
<div class="tab {{#if tabs.properties}}{{tabs.properties.cssClass}}{{/if}}" data-tab="properties" data-group="primary">
{{> systems/ds4/templates/sheets/item/components/properties/armor.hbs}}
{{> systems/ds4/templates/sheets/item/components/properties/protective.hbs}}
{{#if isOwned}}
{{> systems/ds4/templates/sheets/item/components/properties/equipable.hbs}}
{{/if}}
{{> systems/ds4/templates/sheets/item/components/properties/physical.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>

View file

@ -9,26 +9,33 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="properties">{{localize 'DS4.HeadingProperties'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{#if tabs.description}}{{tabs.description.cssClass}}{{/if}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Properties Tab --}}
{{#> systems/ds4/templates/sheets/item/tabs/properties.hbs}}
{{#if isOwned}}
{{> systems/ds4/templates/sheets/item/components/properties/equipable.hbs}}
{{/if}}
{{> systems/ds4/templates/sheets/item/components/properties/physical.hbs}}
{{/systems/ds4/templates/sheets/item/tabs/properties.hbs}}
<div class="tab {{#if tabs.properties}}{{tabs.properties.cssClass}}{{/if}}" data-tab="properties" data-group="primary">
{{#if isOwned}}
{{> systems/ds4/templates/sheets/item/components/properties/equipable.hbs}}
{{/if}}
{{> systems/ds4/templates/sheets/item/components/properties/physical.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>

View file

@ -9,17 +9,25 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{#if tabs.description}}{{tabs.description.cssClass}}{{/if}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>

View file

@ -9,23 +9,30 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="properties">{{localize 'DS4.HeadingProperties'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{#if tabs.description}}{{tabs.description.cssClass}}{{/if}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Properties Tab --}}
{{#> systems/ds4/templates/sheets/item/tabs/properties.hbs}}
{{> systems/ds4/templates/sheets/item/components/properties/physical.hbs}}
{{/systems/ds4/templates/sheets/item/tabs/properties.hbs}}
<div class="tab {{#if tabs.properties}}{{tabs.properties.cssClass}}{{/if}}" data-tab="properties" data-group="primary">
{{> systems/ds4/templates/sheets/item/components/properties/physical.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>

View file

@ -9,17 +9,25 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{#if tabs.description}}{{tabs.description.cssClass}}{{/if}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>

View file

@ -9,27 +9,34 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="properties">{{localize 'DS4.HeadingProperties'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{#if tabs.description}}{{tabs.description.cssClass}}{{/if}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Properties Tab --}}
{{#> systems/ds4/templates/sheets/item/tabs/properties.hbs}}
{{> systems/ds4/templates/sheets/item/components/properties/protective.hbs}}
{{#if isOwned}}
{{> systems/ds4/templates/sheets/item/components/properties/equipable.hbs}}
{{/if}}
{{> systems/ds4/templates/sheets/item/components/properties/physical.hbs}}
{{/systems/ds4/templates/sheets/item/tabs/properties.hbs}}
<div class="tab {{#if tabs.properties}}{{tabs.properties.cssClass}}{{/if}}" data-tab="properties" data-group="primary">
{{> systems/ds4/templates/sheets/item/components/properties/protective.hbs}}
{{#if isOwned}}
{{> systems/ds4/templates/sheets/item/components/properties/equipable.hbs}}
{{/if}}
{{> systems/ds4/templates/sheets/item/components/properties/physical.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>

View file

@ -9,23 +9,30 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="properties">{{localize 'DS4.HeadingProperties'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{#if tabs.description}}{{tabs.description.cssClass}}{{/if}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Properties Tab --}}
{{#> systems/ds4/templates/sheets/item/tabs/properties.hbs}}
{{> systems/ds4/templates/sheets/item/components/properties/special-creature-ability.hbs}}
{{/systems/ds4/templates/sheets/item/tabs/properties.hbs}}
<div class="tab {{#if tabs.properties}}{{tabs.properties.cssClass}}{{/if}}" data-tab="properties" data-group="primary">
{{> systems/ds4/templates/sheets/item/components/properties/special-creature-ability.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>

View file

@ -9,26 +9,33 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="properties">{{localize 'DS4.HeadingProperties'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{tabs.description.cssClass}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Properties Tab --}}
{{#> systems/ds4/templates/sheets/item/tabs/properties.hbs}}
{{> systems/ds4/templates/sheets/item/components/properties/spell.hbs}}
{{#if isOwned}}
{{> systems/ds4/templates/sheets/item/components/properties/equipable.hbs}}
{{/if}}
{{/systems/ds4/templates/sheets/item/tabs/properties.hbs}}
<div class="tab {{tabs.properties.cssClass}}" data-tab="properties" data-group="primary">
{{> systems/ds4/templates/sheets/item/components/properties/spell.hbs}}
{{#if isOwned}}
{{> systems/ds4/templates/sheets/item/components/properties/equipable.hbs}}
{{/if}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{tabs.effects.cssClass}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>

View file

@ -4,17 +4,15 @@ SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab description" data-group="primary" data-tab="description">
{{#if editable}}
<prose-mirror
name="system.description"
button="true"
editable="{{editable}}"
toggled="false"
value="{{data.system.description}}">
{{{enrichedDescription}}}
</prose-mirror>
{{else}}
{{#if editable}}
<prose-mirror
name="system.description"
button="true"
editable="{{editable}}"
toggled="false"
value="{{data.system.description}}">
{{{enrichedDescription}}}
{{/if}}
</div>
</prose-mirror>
{{else}}
{{{enrichedDescription}}}
{{/if}}

View file

@ -4,15 +4,13 @@ SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab effects" data-group="primary" data-tab="effects">
{{#unless (isEmpty enrichedEffects)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--item-effect effect-list">
{{> systems/ds4/templates/sheets/item/components/effect-list-header.hbs}}
{{#each enrichedEffects as |effectData id| }}
{{> systems/ds4/templates/sheets/item/components/effect-list-entry.hbs effectData=effectData}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddEffectTitle'
documentType='effect'}}
</div>
{{#unless (isEmpty enrichedEffects)}}
<ol class="ds4-embedded-document-list ds4-embedded-document-list--item-effect effect-list">
{{> systems/ds4/templates/sheets/item/components/effect-list-header.hbs}}
{{#each enrichedEffects as |effectData id| }}
{{> systems/ds4/templates/sheets/item/components/effect-list-entry.hbs effectData=effectData}}
{{/each}}
</ol>
{{/unless}}
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddEffectTitle'
documentType='effect'}}

View file

@ -4,6 +4,4 @@ SPDX-FileCopyrightText: 2021 Johannes Loher
SPDX-License-Identifier: MIT
--}}
<div class="ds4-sheet-tab tab properties" data-group="primary" data-tab="properties">
{{> @partial-block}}
</div>
{{> @partial-block}}

View file

@ -9,23 +9,30 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="properties">{{localize 'DS4.HeadingProperties'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{#if tabs.description}}{{tabs.description.cssClass}}{{/if}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Properties Tab --}}
{{#> systems/ds4/templates/sheets/item/tabs/properties.hbs}}
{{> systems/ds4/templates/sheets/item/components/properties/talent.hbs}}
{{/systems/ds4/templates/sheets/item/tabs/properties.hbs}}
<div class="tab {{#if tabs.properties}}{{tabs.properties.cssClass}}{{/if}}" data-tab="properties" data-group="primary">
{{> systems/ds4/templates/sheets/item/components/properties/talent.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>

View file

@ -9,27 +9,34 @@ SPDX-License-Identifier: MIT
{{> systems/ds4/templates/sheets/item/components/item-header.hbs}}
{{!-- Sheet Tab Navigation --}}
<nav class="ds4-sheet-tab-nav tabs" data-group="primary">
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="properties">{{localize 'DS4.HeadingProperties'}}</a>
<a class="ds4-sheet-tab-nav__item" data-action="changeTab" data-tab="effects">{{localize 'DS4.HeadingEffects'}}</a>
<nav class="tabs" data-group="primary">
{{#each tabs}}
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
{{label}}
</a>
{{/each}}
</nav>
{{!-- Sheet Body --}}
<section class="ds4-sheet-body">
<section class="sheet-body">
{{!-- Description Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
<div class="tab {{#if tabs.description}}{{tabs.description.cssClass}}{{/if}}" data-tab="description" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/description.hbs}}
</div>
{{!-- Properties Tab --}}
{{#> systems/ds4/templates/sheets/item/tabs/properties.hbs}}
{{> systems/ds4/templates/sheets/item/components/properties/weapon.hbs}}
{{#if isOwned}}
{{> systems/ds4/templates/sheets/item/components/properties/equipable.hbs}}
{{/if}}
{{> systems/ds4/templates/sheets/item/components/properties/physical.hbs}}
{{/systems/ds4/templates/sheets/item/tabs/properties.hbs}}
<div class="tab {{#if tabs.properties}}{{tabs.properties.cssClass}}{{/if}}" data-tab="properties" data-group="primary">
{{> systems/ds4/templates/sheets/item/components/properties/weapon.hbs}}
{{#if isOwned}}
{{> systems/ds4/templates/sheets/item/components/properties/equipable.hbs}}
{{/if}}
{{> systems/ds4/templates/sheets/item/components/properties/physical.hbs}}
</div>
{{!-- Effects Tab --}}
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
{{> systems/ds4/templates/sheets/item/tabs/effects.hbs}}
</div>
</section>
</form>