Get started on the required infrastructure for the attributes tab

This commit is contained in:
Oliver 2026-04-23 17:46:40 -06:00
parent 2c915c82e8
commit f1499d1c3d
4 changed files with 79 additions and 64 deletions

View file

@ -1,34 +0,0 @@
{{#if hasAttributes}}
<div class="attributes">
{{#each attrs as | attr |}}
<fieldset data-attribute="{{ attr.id }}">
<legend>
{{ attr.name }}
</legend>
<div class="attr-range">
<input
type="number"
class="attr-range__value"
name="{{attr.path}}.value"
value="{{attr.value}}"
aria-label="{{localize "taf.Apps.PlayerSheet.current-value"}}"
data-tooltip="@{{ attr.id }}{{#if attr.isRange}}.value{{/if}}"
>
{{#if attr.isRange}}
<span aria-hidden="true">/</span>
<input
type="number"
class="attr-range__max"
name="{{attr.path}}.max"
value="{{attr.max}}"
aria-label="{{localize "taf.Apps.PlayerSheet.max-value"}}"
data-tooltip="@{{ attr.id }}.max"
>
{{/if}}
</div>
</fieldset>
{{/each}}
</div>
{{else}}
<template />
{{/if}}

View file

@ -0,0 +1,51 @@
{{#if hasAttributes}}
<div class="attributes">
{{#each attrs as | attr |}}
<fieldset data-foreign-uuid="{{ attr.uuid }}">
<legend>
{{ attr.name }}
</legend>
<div class="attr-range">
{{#if attr.system.isRange }}
<input
type="number"
id="{{attr.uuid}}-value"
class="attr-range__value"
data-foreign-name="system.value"
value="{{attr.system.value}}"
min="{{attr.system.min}}"
max="{{attr.system.max}}"
aria-label="{{localize "taf.Apps.PlayerSheet.current-value"}}"
data-tooltip="@{{ attr.system.key }}.value"
>
<span aria-hidden="true">/</span>
<input
type="number"
id="{{attr.uuid}}-max"
class="attr-range__max"
data-foreign-name="system.max"
value="{{attr.system.max}}"
min="{{attr.system.min}}"
aria-label="{{localize "taf.Apps.PlayerSheet.max-value"}}"
data-tooltip="@{{ attr.system.key }}.max"
>
{{else}}
<input
type="number"
id="{{attr.uuid}}-value"
class="attr-range__value"
data-foreign-name="system.value"
value="{{attr.system.value}}"
min="{{attr.system.min}}"
max="{{attr.system.max}}"
aria-label="{{localize "taf.Apps.PlayerSheet.current-value"}}"
data-tooltip="@{{ attr.system.key }}"
>
{{/if}}
</div>
</fieldset>
{{/each}}
</div>
{{else}}
<template />
{{/if}}