Bug/103 enrich htmlfield content before its used in applications (#369)

* FIX: Add enritch to HTMLField
FIX: Remove no-HTMLField from Manifest
FIX: Convert Scar's HTMLField to StringField
FIX: Remove unused HTMLField

* REMOVE unused hanldebars helpers

* FEAT: add inventory-fieldset-items-V2 and inventory-item-V2  partials for Actors

* FIX showLabels to hideTags

* FEAT: add template to items sheet

* FEAT: add effects tabs on ItemSheet

* FEAT: add context menus for all inventory-items

* FEAT: add resources to inventory-item template

* FEAT: add enritch on inventory-item description
FEAT: add extensible behavior on inventory-item-content
FEAT: add fade effect on item-img to roll-itmg

* FEAT: add eritch to NPC description
FIX: missing htmlFieldss on manfiest
FIX: add misisng localizations

* FIX_ minor fixes

* Little resource fix. Noone will notice ._.

* FIX: remove default list styles
FIX: .extended css reduce max-height, shorten animation duration to 0.5s, and set overflow to auto.
FIX: set enriched=notes.enriche on notes.hbs
FIX: set experience.value on sidebar.hbs
FIX: move tooltip from item-img to img-portrait on inventory-item-V2.hbs
REMOVE: unused files

---------

Co-authored-by: Joaquin Pereyra <joaquinpereyra98@users.noreply.github.com>
Co-authored-by: WBHarry <williambjrklund@gmail.com>
This commit is contained in:
joaquinpereyra98 2025-07-19 17:21:46 -03:00 committed by GitHub
parent 615df65415
commit b8930b18a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 1768 additions and 1434 deletions

View file

@ -1,34 +1,22 @@
<li class="card-item" data-item-id="{{item.id}}" data-item-id="{{item.id}}">
<li class="card-item" data-item-uuid="{{item.uuid}}">
<img src="{{item.img}}" data-action="useItem" class="card-img" />
<div class="card-label">
<div class="menu {{#if item.system.resource}}resource-menu{{/if}} {{#if (eq item.system.resource.type 'diceValue')}}dice-menu{{/if}}">
<div
class="menu {{#if item.system.resource}}resource-menu{{/if}} {{#if (eq item.system.resource.type 'diceValue')}}dice-menu{{/if}}">
{{#if item.system.resource}}
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
{{/if}}
<div class="controls">
{{#if (eq type 'weapon')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem" data-tooltip="{{#unless item.system.equipped}}{{localize 'DAGGERHEART.UI.Tooltip.equip'}}{{else}}{{localize 'DAGGERHEART.UI.Tooltip.unequip'}}{{/unless}}">
<i class="fa-solid fa-hands"></i>
</a>
{{/if}}
{{#if (eq type 'armor')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem" data-tooltip="{{#unless item.system.equipped}}{{localize 'DAGGERHEART.UI.Tooltip.equip'}}{{else}}{{localize 'DAGGERHEART.UI.Tooltip.unequip'}}{{/unless}}">
<i class="fa-solid fa-shield"></i>
</a>
{{/if}}
{{#if (eq type 'domainCard')}}
{{#unless item.system.inVault}}
<a data-action="toggleVault" data-tooltip="{{localize 'DAGGERHEART.UI.Tooltip.sendToVault'}}">
<i class="fa-solid fa-arrow-down"></i>
</a>
{{else}}
<a data-action="toggleVault" data-tooltip="{{localize 'DAGGERHEART.UI.Tooltip.sendToLoadout'}}">
<i class="fa-solid fa-arrow-up"></i>
</a>
{{/unless}}
{{/if}}
<a data-action="toChat" data-tooltip="{{localize 'DAGGERHEART.UI.Tooltip.sendToChat'}}"><i class="fa-regular fa-message"></i></a>
<a data-action="triggerContextMenu" data-tooltip="{{localize 'DAGGERHEART.UI.Tooltip.moreOptions'}}"><i class="fa-solid fa-ellipsis-vertical"></i></a>
<a data-action="toggleVault"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.inVault 'sendToLoadout' 'sendToVault' }}">
<i class="fa-solid {{ifThen item.system.inVault 'fa-arrow-up' 'fa-arrow-down'}}"></i>
</a>
<a data-action="toChat" data-tooltip="DAGGERHEART.UI.Tooltip.sendToChat">
<i class="fa-regular fa-message"></i>
</a>
<a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions">
<i class="fa-solid fa-ellipsis-vertical"></i>
</a>
</div>
</div>
<div class="card-name">{{item.name}}</div>

View file

@ -1,30 +1,18 @@
<li class='feature-item' data-feature-id='{{feature.id}}'>
<li class='feature-item' data-item-uuid='{{feature.uuid}}'>
<div class='feature-line'>
<img class='image' src='{{feature.img}}' />
<h4>
{{feature.name}}
</h4>
{{#unless hideContrals}}
<div class='controls'>
<a
class='effect-control'
data-action='editFeature'
data-feature='{{feature._id}}'
data-type='{{type}}'
data-tooltip='{{localize "DAGGERHEART.UI.Tooltip.openItemWorld"}}'
>
<i class="fa-solid fa-globe"></i>
</a>
<a
class='effect-control'
data-action='deleteFeature'
data-feature='{{feature._id}}'
data-type='{{type}}'
data-tooltip='{{localize "CONTROLS.CommonDelete"}}'
>
<i class='fas fa-trash'></i>
</a>
</div>
<div class='controls'>
<a class='effect-control' data-action='editDoc' data-tooltip="DAGGERHEART.UI.Tooltip.openItemWorld">
<i class="fa-solid fa-globe"></i>
</a>
<a class='effect-control' data-action='deleteFeature' data-tooltip="CONTROLS.CommonDelete">
<i class='fas fa-trash'></i>
</a>
</div>
{{/unless}}
</div>
</li>

View file

@ -0,0 +1,70 @@
{{!--
Inventory/Domain Card Section
{{> 'daggerheart.inventory-items' }}
Parameters:
- title {string} : Localization key used for the legend.
- collection {array} : Array of items to render.
- type {string} : The type of items in the list:
- isGlassy {boolean} : If true, applies the 'glassy' class to the fieldset.
- cardView {boolean} : If true and type is 'domainCard', renders using domain card layout.
- isActor {boolean} : Passed through to inventory-item partials.
- canCreate {boolean} : If true, show createDoc anchor on legend
- inVault {boolean} : If true, the domainCard is created with inVault=true
- disabled {boolean}: If true, the ActiveEffect is created with disabled=true;
- categoryAdversary {string} : Category adversary id.
- showLabels {boolean} : If true, show label-tags else show simple tags.
- hideTooltip {boolean} : If true, disables the tooltip on the item image.
- hideControls {boolean} : If true, hides the controls inside inventory-item partials.
- hideDescription {boolean} : If true, hides the item's description.
- hideResources {boolean} : If true, hides the item's resources.
- showActions {boolean} : If true show feature's actions.
--}}
<fieldset class="{{#if isGlassy}}glassy{{/if}}">
<legend>
{{localize title}}
{{#if canCreate}}
<a data-action="createDoc" data-document-class="{{ifThen (eq type 'effect') 'ActiveEffect' 'Item' }}"
data-type="{{ifThen (eq type 'effect') 'base' type}}"
{{#if inVault}}data-in-vault="{{inVault}}"{{/if}}
{{#if disabled}} data-disabled="{{disabled}}"{{/if}}
data-tooltip="{{localize 'DOCUMENT.Create' type=''}}"
>
<i class="fa-solid fa-plus icon-button"></i>
</a>
{{/if }}
</legend>
{{#if (and cardView (eq type 'domainCard'))}}
<ul class="card-list">
{{#each collection as |item|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/domain-card-item.hbs'
item=item
type='domainCard'
}}
{{/each}}
</ul>
{{else}}
<ul class="items-list">
{{#each collection as |item|}}
{{> 'daggerheart.inventory-item'
item=item
type=../type
hideControls=../hideControls
isActor=../isActor
categoryAdversary=../categoryAdversary
hideTooltip=../hideTooltip
showLabels=../showLabels
isAction=../isAction
hideResources=../hideResources
showActions=../showActions
}}
{{/each}}
</ul>
{{/if}}
</fieldset>

View file

@ -1,44 +0,0 @@
<fieldset class="{{#if isGlassy}}glassy{{/if}}">
<legend>{{title}}</legend>
<ul class="items-list">
{{#unless (eq cardView 'card') }}
{{#if (or (eq type 'domainCard') (eq type 'armor') (eq type 'consumable') (eq type 'miscellaneous') (eq type 'weapon'))}}
{{#each document.items as |item|}}
{{#if (eq item.type ../type)}}
{{#unless (and (eq ../type 'domainCard') (or (and item.system.inVault (not ../isVault)) (and (not item.system.inVault) ../isVault)))}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=item type=../type}}
{{/unless}}
{{/if}}
{{/each}}
{{else}}
{{#if (eq type 'effect')}}
{{#each document.effects as |effect|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=effect type=../type}}
{{/each}}
{{else}}
{{#each values}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=this type=../type hideControls=../hideControls featureType=true }}
{{/each}}
{{#each adversaries as |adversary|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=adversary type='adversary' hideControls=true isActor=true categoryAdversary=@../key}}
{{/each}}
{{/if}}
{{/if}}
{{/unless}}
</ul>
{{#if (and (eq cardView 'card') (eq type 'domainCard'))}}
<ul class="card-list">
{{#if isVault}}
{{#each document.system.domainCards.vault as |card|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/domain-card-item.hbs' item=card type=../type}}
{{/each}}
{{else}}
{{#each document.system.domainCards.loadout as |card|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/domain-card-item.hbs' item=card type=../type}}
{{/each}}
{{/if}}
</ul>
{{/if}}
</fieldset>

View file

@ -0,0 +1,239 @@
{{!--
{{> 'daggerheart.inventory-item' }}
Parameters:
- type {string} : The type of items in the list
- isActor {boolean} : Passed through to inventory-item partials.
- categoryAdversary {string} : Category adversary id.
- noExtensible {boolean} : If true, the inventory-item-content would be collapsable/extendible else it always be showed
- hideLabels {boolean} : If true, hide label-tags else show label-tags.
- hideTags {boolean} : If true, hide simple-tags else show simple-tags.
- hideTooltip {boolean} : If true, disables the tooltip on the item image.
- hideControls {boolean} : If true, hides the controls inside inventory-item partials.
- hideDescription {boolean} : If true, hides the item's description.
- hideResources {boolean} : If true, hides the item's resources.
- showActions {boolean} : If true show feature's actions.
--}}
<li class="inventory-item" {{#if (eq type 'action' )}}data-action-id="{{item.id}}" {{/if}}
data-item-uuid="{{item.uuid}}" data-type="{{type}}" draggable="true">
<div class="inventory-item-header" {{#unless noExtensible}}data-action="toggleExtended" {{/unless}}>
{{!-- Image --}}
<div class="img-portait"
data-action='{{ifThen (hasProperty item "use") "useItem" (ifThen (hasProperty item "toChat") "toChat" "editDoc") }}'
{{#unless hideTooltip}}data-tooltip="#item#{{item.uuid}}" {{/unless}}>
<img src="{{item.img}}" class="item-img {{#if isActor}}actor-img{{/if}}" />
<img class="roll-img" src="systems/daggerheart/assets/icons/dice/default/d20.svg" alt="d20">
</div>
{{!-- Name & Tags --}}
<div class="item-label {{#if hideResources}}fullWidth{{/if}}">
{{!-- Item Name --}}
<div class="item-name">{{item.name}}</div>
{{!-- Weapon Block Start --}}
{{#if (eq type 'weapon')}}
{{#if (not hideTags)}}
<div class="item-tags">
<div class="tag">
{{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.name')}}
</div>
<div class="tag">
{{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.name')}}
</div>
<div class="tag">
{{item.system.attack.damage.parts.0.value.dice}}
{{#if item.system.attack.damage.parts.0.value.bonus}} +
{{item.system.attack.damage.parts.0.value.bonus}}{{/if}}
(
{{#each item.system.attack.damage.parts.0.type as |type|}}
{{localize (concat 'DAGGERHEART.CONFIG.DamageType.' type '.abbreviation')}}
{{#unless @last}}|{{/unless}}
{{/each}}
)
</div>
<div class="tag">
{{localize (concat 'DAGGERHEART.CONFIG.Burden.' item.system.burden)}}
</div>
</div>
{{else if (not hideLabels)}}
<div class="item-labels">
<div class="label">
{{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.short')}}
{{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.short')}}
<span> - </span>
{{item.system.attack.damage.parts.0.value.dice}}
{{#if item.system.attack.damage.parts.0.value.bonus}} +
{{item.system.attack.damage.parts.0.value.bonus}}
{{/if}}
{{#with (lookup @root.config.GENERAL.damageTypes item.system.attack.damage.parts.0.type)}}
{{#each icon}}<i class="fa-solid {{this}}"></i>{{/each}}
{{/with}}
</div>
</div>
{{/if}}
{{/if}}
{{!-- Weapon Block End --}}
{{!-- Armor Block Start --}}
{{#if (eq type 'armor')}}
{{#if (not hideTags)}}
<div class="item-tags">
<div class="tag">{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}: {{item.system.baseScore}}</div>
<div class="tag">
{{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.base"}}:
{{item.system.baseThresholds.major}} / {{item.system.baseThresholds.severe}}
</div>
</div>
{{else if (not hideLabels)}}
<div class="item-labels">
<div class="label">
{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}: {{item.system.baseScore}}
</div>
</div>
{{/if}}
{{/if}}
{{!-- Armor Block End --}}
{{!-- Domain Card Block Start --}}
{{#if (eq type 'domainCard')}}
{{#if (not hideTags)}}
<div class="item-tags">
<div class="tag">{{localize (concat 'DAGGERHEART.CONFIG.DomainCardTypes.' item.system.type)}}</div>
<div class="tag">{{localize (concat 'DAGGERHEART.GENERAL.Domain.' item.system.domain '.label')}}</div>
<div class="tag">
<span class="recall-label">{{localize "DAGGERHEART.ITEMS.DomainCard.recallCost"}}: </span>
<span class="recall-value">{{item.system.recallCost}}</span>
</div>
</div>
{{else if (not hideLabels)}}
<div class="item-labels">
<div class="label">
{{localize (concat 'DAGGERHEART.CONFIG.DomainCardTypes.' item.system.type)}} -
{{localize (concat 'DAGGERHEART.GENERAL.Domain.' item.system.domain '.label')}} -
<span class="recall-value">{{item.system.recallCost}}</span>
<i class="fa-solid fa-bolt"></i>
</div>
</div>
{{/if}}
{{/if}}
{{!-- Domain Card Block End --}}
{{!-- Effect Block Start --}}
{{#if (eq type 'effect')}}
{{#if (not hideTags)}}
<div class="item-tags">
<div class="tag">
{{localize item.parent.system.metadata.label}}: {{item.parent.name}}
</div>
<div class="tag">
{{#if item.duration.duration}}
{{localize 'DAGGERHEART.EFFECTS.Duration.temporary'}}
{{else}}
{{localize 'DAGGERHEART.EFFECTS.Duration.passive'}}
{{/if}}
</div>
{{#each item.statuses as |status|}}
<div class="tag">{{localize (concat 'DAGGERHEART.CONFIG.Condition.' status '.name')}}</div>
{{/each}}
</div>
{{else if (not hideLabels)}}
{{!-- Empty --}}
{{/if}}
{{/if}}
{{!-- Effect Block End --}}
{{!-- Action Block Start --}}
{{#if (eq type 'action')}}
{{#if (not hideTags)}}
<div class="item-tags">
<div class="tag">{{localize (concat 'DAGGERHEART.ACTIONS.TYPES.' item.type '.name')}}</div>
<div class="tag">{{localize (concat 'DAGGERHEART.CONFIG.ActionType.' item.actionType)}}</div>
</div>
{{else if (not hideLabels)}}
{{!-- Empty --}}
{{/if}}
{{/if}}
{{!-- Action Block End --}}
</div>
{{!-- Simple Resource --}}
{{#if (and (not hideResources) (eq item.system.resource.type 'simple'))}}
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
{{/if}}
{{#if (and (not hideResources) item.system.quantity)}}
<div class="item-resource">
<input type="number" class="inventory-item-quantity" value="{{item.system.quantity}}" step="1" />
</div>
{{/if}}
{{!-- Controls --}}
{{#unless hideControls}}
<div class="controls">
{{#if isActor}}
<a data-action="editDoc" data-tooltip="DAGGERHEART.UI.Tooltip.openActorWorld">
<i class="fa-solid fa-globe"></i>
</a>
{{#if (eq type 'adversary')}}
<a data-action='deleteAdversary' data-category="{{categoryAdversary}}" data-tooltip="CONTROLS.CommonDelete">
<i class='fas fa-trash'></i>
</a>
{{/if}}
{{else}}
{{#if (eq type 'weapon')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.equipped 'unequip' 'equip' }}">
<i class="fa-solid fa-hands"></i>
</a>
{{else if (eq type 'armor')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.equipped 'unequip' 'equip' }}">
<i class="fa-solid fa-shield"></i>
</a>
{{else if (eq type 'domainCard')}}
<a data-action="toggleVault"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.inVault 'sendToLoadout' 'sendToVault' }}">
<i class="fa-solid {{ifThen item.system.inVault 'fa-arrow-up' 'fa-arrow-down'}}"></i>
</a>
{{else if (eq type 'effect')}}
<a data-action="toggleEffect"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.disabled 'enableEffect' 'disableEffect' }}">
<i class="{{ifThen item.disabled 'fa-regular fa-lightbulb' 'fa-solid fa-lightbulb'}}"></i>
</a>
{{/if}}
{{#if (hasProperty item "toChat")}}
<a data-action="toChat" data-tooltip="DAGGERHEART.UI.Tooltip.sendToChat">
<i class="fa-regular fa-message"></i>
</a>
{{/if}}
<a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions">
<i class="fa-solid fa-ellipsis-vertical"></i>
</a>
{{/if}}
</div>
{{/unless}}
</div>
<div class="inventory-item-content{{#unless noExtensible}} extensible{{/unless}}">
{{!-- Description --}}
{{#unless hideDescription}}
<div class="invetory-description"></div>
{{/unless}}
{{!-- Dice Resource --}}
{{#if (and (not hideResources) (eq item.system.resource.type 'diceValue'))}}
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
{{/if}}
{{!-- Actions Buttons --}}
{{#if (and showActions (eq item.type 'feature'))}}
<div class="item-buttons">
{{#each item.system.actions as | action |}}
<button type="button" data-action="useAction" data-action-id="{{action.id}}">
{{action.name}}
</button>
{{/each}}
</div>
{{/if}}
</div>
</li>

View file

@ -1,197 +0,0 @@
<li class="inventory-item" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-type="{{type}}" draggable="true">
<img src="{{item.img}}" class="item-img {{#if isActor}}actor-img{{/if}}" data-action="useItem" {{#if (not noTooltip)}}data-tooltip="{{concat "#item#" item.uuid}}"{{/if}} />
<div class="item-label-wrapper">
<div class="item-label {{#unless (and (not isSidebar) (or (eq item.system.resource.type 'simple') item.system.quantity))}}fullWidth{{/unless}}">
{{#if isCompanion}}
<a class="item-name" data-action="attackRoll">{{item.name}}</a>
{{else}}
<div class="item-name">{{item.name}}</div>
{{/if}}
{{#if (eq type 'weapon')}}
<div class="item-tags">
{{#if isSidebar}}
<div class="item-labels">
<div class="label">
{{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.short')}}
{{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.short')}}
<span> - </span>
{{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}}
{{#each item.system.attack.damage.parts.0.type as | type | }}
{{#with (lookup @root.config.GENERAL.damageTypes type)}}
<i class="fa-solid {{icon}}"></i>
{{/with}}
{{/each}}
</div>
</div>
{{else}}
<div class="tag">
{{localize (concat 'DAGGERHEART.CONFIG.Traits.' item.system.attack.roll.trait '.name')}}
</div>
<div class="tag">
{{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.name')}}
</div>
<div class="tag">
{{item.system.attack.damage.parts.0.value.dice}}{{#if item.system.attack.damage.parts.0.value.bonus}} + {{item.system.attack.damage.parts.0.value.bonus}}{{/if}}
(
{{#each item.system.attack.damage.parts.0.type}}
{{localize (concat 'DAGGERHEART.CONFIG.DamageType.' this '.abbreviation')}}
{{/each}}
)
</div>
<div class="tag">
{{localize (concat 'DAGGERHEART.CONFIG.Burden.' item.system.burden)}}
</div>
{{/if}}
</div>
{{/if}}
{{#if (eq type 'armor')}}
{{#if isSidebar}}
<div class="item-labels">
<div class="label">
{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}:
{{item.system.baseScore}}
</div>
</div>
{{else}}
<div class="item-tags">
<div class="tag">
{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}:
{{item.system.baseScore}}
</div>
<div class="tag">
{{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.base"}}:
{{item.system.baseThresholds.major}}
<span>/</span>
{{item.system.baseThresholds.severe}}
</div>
</div>
{{/if}}
{{/if}}
{{#if (eq type 'domainCard')}}
{{#if isSidebar}}
<div class="item-labels">
<div class="label">
{{localize (concat 'DAGGERHEART.CONFIG.DomainCardTypes.' item.system.type)}}
<span> - </span>
{{localize (concat 'DAGGERHEART.GENERAL.Domain.' item.system.domain '.label')}}
<span> - </span>
<span class="recall-value">{{item.system.recallCost}}</span>
<i class="fa-solid fa-bolt"></i>
</div>
</div>
{{else}}
<div class="item-tags">
<div class="tag">
{{localize (concat 'DAGGERHEART.CONFIG.DomainCardTypes.' item.system.type)}}
</div>
<div class="tag">
{{localize (concat 'DAGGERHEART.GENERAL.Domain.' item.system.domain '.label')}}
</div>
<div class="tag">
<span class="recall-label">{{localize "DAGGERHEART.ITEMS.DomainCard.recallCost"}}: </span>
<span class="recall-value">{{item.system.recallCost}}</span>
</div>
</div>
{{/if}}
{{/if}}
{{#if (eq type 'effect')}}
<div class="item-tags">
<div class="tag">
{{localize (concat 'TYPES.Item.' item.parent.type)}}
<span>: </span>
{{item.parent.name}}
</div>
<div class="tag">
{{#if item.duration.duration}}
{{localize 'DAGGERHEART.EFFECTS.Duration.temporary'}}
{{else}}
{{localize 'DAGGERHEART.EFFECTS.Duration.passive'}}
{{/if}}
</div>
{{#each item.statuses as |status|}}
<div class="tag">
{{localize (concat 'DAGGERHEART.CONFIG.Condition.' status '.name')}}
</div>
{{/each}}
</div>
{{/if}}
{{#if (eq type 'action')}}
<div class="item-tags">
<div class="tag">
{{localize (concat 'DAGGERHEART.ACTIONS.TYPES.' item.type '.name')}}
</div>
<div class="tag">
{{localize (concat 'DAGGERHEART.CONFIG.ActionType.' item.actionType)}}
</div>
</div>
{{/if}}
</div>
{{#if (and (not isSidebar) (eq item.system.resource.type 'simple'))}}
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
{{/if}}
{{#if (and (not isSidebar) item.system.quantity)}}
<div class="item-resource">
<input type="number" class="inventory-item-quantity" value="{{item.system.quantity}}" step="1" />
</div>
{{/if}}
</div>
{{#unless hideControls}}
{{#if isActor}}
<div class="controls">
{{#if (eq type 'actor')}}
<a data-action="viewActor" data-potential-adversary="{{categoryAdversary}}" data-adversary="{{item.uuid}}" data-tooltip='{{localize "DAGGERHEART.UI.Tooltip.openActorWorld"}}'>
<i class="fa-solid fa-globe"></i>
</a>
{{/if}}
{{#if (eq type 'adversary')}}
<a data-action="viewAdversary" data-potential-adversary="{{categoryAdversary}}" data-adversary="{{item.uuid}}" data-tooltip='{{localize "DAGGERHEART.UI.Tooltip.openActorWorld"}}'>
<i class="fa-solid fa-globe"></i>
</a>
<a data-action='deleteAdversary' data-potential-adversary="{{categoryAdversary}}" data-adversary="{{item.uuid}}" data-tooltip='{{localize "CONTROLS.CommonDelete"}}'>
<i class='fas fa-trash'></i>
</a>
{{/if}}
</div>
{{else}}
<div class="controls">
{{#if (eq type 'weapon')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem" data-tooltip="{{#unless item.system.equipped}}{{localize 'DAGGERHEART.UI.Tooltip.equip'}}{{else}}{{localize 'DAGGERHEART.UI.Tooltip.unequip'}}{{/unless}}">
<i class="fa-solid fa-hands"></i>
</a>
{{/if}}
{{#if (eq type 'armor')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem" data-tooltip="{{#unless item.system.equipped}}{{localize 'DAGGERHEART.UI.Tooltip.equip'}}{{else}}{{localize 'DAGGERHEART.UI.Tooltip.unequip'}}{{/unless}}">
<i class="fa-solid fa-shield"></i>
</a>
{{/if}}
{{#if (eq type 'domainCard')}}
{{#unless item.system.inVault}}
<a data-action="toggleVault" data-tooltip="{{localize 'DAGGERHEART.UI.Tooltip.sendToVault'}}">
<i class="fa-solid fa-arrow-down"></i>
</a>
{{else}}
<a data-action="toggleVault" data-tooltip="{{localize 'DAGGERHEART.UI.Tooltip.sendToLoadout'}}">
<i class="fa-solid fa-arrow-up"></i>
</a>
{{/unless}}
{{/if}}
<a data-action="toChat" data-tooltip="{{localize 'DAGGERHEART.UI.Tooltip.sendToChat'}}"><i class="fa-regular fa-message"></i></a>
<a data-action="triggerContextMenu" data-tooltip="{{localize 'DAGGERHEART.UI.Tooltip.moreOptions'}}"><i class="fa-solid fa-ellipsis-vertical"></i></a>
</div>
{{/if}}
{{else}}
<span></span>
{{/unless}}
<div class="item-description">{{#unless isSidebar}}{{{item.system.description}}}{{/unless}}</div>
{{#if (and (not isSidebar) (eq item.system.resource.type 'diceValue'))}}
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
{{/if}}
{{#if featureType}}
<div class="item-buttons">
{{#each item.system.actions as | action |}}
<button type="button" data-action="useAction" data-action-id="{{action.id}}">{{action.name}}</button>
{{/each}}
</div>
{{/if}}
</li>

View file

@ -3,22 +3,11 @@
data-tab='{{tabs.actions.id}}'
data-group='{{tabs.actions.group}}'
>
<fieldset class="one-column">
<legend>{{localize "DAGGERHEART.GENERAL.Action.plural"}} <a><i class="fa-solid fa-plus icon-button" data-action="addAction"></i></a></legend>
<div class="actions-list">
{{#each document.system.actions as |action index|}}
<div class="action-item"
data-action="editAction"
data-index="{{index}}"
data-tooltip="{{concat "#item#" @root.document.uuid "#action#" action.id}}"
>
<img class="image" src="{{action.img}}" />
<span>{{action.name}}</span>
<div class="controls">
<a data-action="removeAction"><i class="fa-solid fa-trash"></i></a>
</div>
</div>
{{/each}}
</div>
</fieldset>
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.Action.plural'
collection=document.system.actions
type='action'
canCreate=true
}}
</section>

View file

@ -1,26 +1,21 @@
<section
class='tab {{tabs.effects.cssClass}} {{tabs.effects.id}}'
data-tab='{{tabs.effects.id}}'
data-group='{{tabs.effects.group}}'
>
<fieldset class="one-column">
<legend>
{{localize "DAGGERHEART.GENERAL.Effect.plural"}}
<a data-action="createDoc" data-document-class="ActiveEffect" data-type="base">
<i class="fa-solid fa-plus icon-button"></i>
</a>
</legend>
<div class="effects-list">
{{#each document.effects as |effect|}}
<div class="effect-item">
<img class="image" src="{{effect.img}}" />
<span>{{effect.name}}</span>
<div class="controls">
<a data-action="editDoc" data-type="ActiveEffect" data-doc-id="{{effect.id}}"><i class="fa-solid fa-pen-to-square"></i></a>
<a data-action="deleteDoc" data-type="ActiveEffect" data-doc-id="{{effect.id}}" {{disabled effect.mandatory}}><i class="fa-solid fa-trash icon-button {{disabled effect.mandatory}}"></i></a>
</div>
</div>
{{/each}}
</div>
</fieldset>
<section class='tab {{tabs.effects.cssClass}} {{tabs.effects.id}}' data-tab='{{tabs.effects.id}}'
data-group='{{tabs.effects.group}}'>
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.activeEffects'
type='effect'
isGlassy=true
collection=effects.actives
canCreate=true
hideResources=true
}}
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.inactiveEffects'
type='effect'
isGlassy=true
collection=effects.inactives
canCreate=true
hideResources=true
}}
</section>

View file

@ -1,14 +0,0 @@
<section
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'
>
<fieldset>
<legend>{{localize "DAGGERHEART.GENERAL.Tabs.features"}}</legend>
<div class="feature-list">
{{#each source.system.abilities as |feature key|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/feature-section-item.hbs' feature=feature}}
{{/each}}
</div>
</fieldset>
</section>

View file

@ -1,23 +1,11 @@
<section
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'
>
<fieldset class="one-column drop-section">
<legend>{{localize "DAGGERHEART.GENERAL.features"}} <a><i data-action="addFeature" class="fa-solid fa-plus icon-button"></i></a></legend>
<div class="features-list">
{{#each document.system.features as |feature|}}
<div class="feature-item"
data-action="editFeature"
id="{{feature.id}}"
>
<img class="image" src="{{feature.img}}" data-tooltip="{{concat "#item#" feature.uuid}}" />
<span>{{feature.name}}</span>
<div class="controls">
<a data-action="removeFeature" id="{{feature.id}}"><i class="fa-solid fa-trash"></i></a>
</div>
</div>
{{/each}}
</div>
</fieldset>
<section class='tab {{tabs.features.cssClass}} {{tabs.features.id}}' data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'>
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.features'
type='feature'
isGlassy=true
collection=document.system.features
canCreate=(or document.parent isGM)
showActions=false
}}
</section>