daggerheart/templates/sheets/global/partials/domain-card-item.hbs
Iohan Trézze 5f9407319f Enable sorting for Loadout domain cards
Add drag-and-drop sorting functionality to Loadout and Vault sections
by reusing the exact pattern already implemented for Loot items:

- Add `data-item-id` and `draggable="true"` attributes to domain card
  template (domain-card-item.hbs) following inventory-item-V2.hbs pattern

- Sort domain cards by Foundry's `sort` property in the domainCards
  getter (character.mjs) following base-actor.mjs pattern for inventory

This enables users to reorder domain cards by dragging, with order
persistence across page reloads, just like Loot already supports.

Fixes: Sorting works for loot, but not the Loadout

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-15 23:58:14 -03:00

28 lines
No EOL
1.5 KiB
Handlebars

<li class="card-item" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-type="domainCard">
<img src="{{item.img}}" data-action="useItem" class="card-img" draggable="true" />
<span class="item-icon recall-cost">
<span class="recall-value">{{item.system.recallCost}}</span>
<i class="fa-solid fa-bolt"></i>
</span>
<div class="card-label">
<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"}}
{{/if}}
<div class="controls">
<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>
<span class="card-name" data-action="viewItem">{{item.name}}</span>
</div>
</li>