ds4/src/templates/actor/partials/attributes-traits.hbs

52 lines
2.3 KiB
Handlebars

{{!-- ======================================================================== --}}
{{!-- INLINE PARTIAL DEFINITIONS --}}
{{!-- ======================================================================== --}}
{{!--
!-- Render an attribute.
!--
!-- @param attribute-label: The label to display for the attribute
!-- @param attribute-key: The key of the attribute
!-- @param attribute-data: The data for the attribute
--}}
{{#*inline "attribute"}}
<div class="attribute flexrow"><label for="data.attributes.body.total"
class="attribute-label ">{{attribute-label}}</label>
<div class="attribute-value flex15 grid grid-8col"><input type="number"
name="data.attributes.{{attribute-key}}.base" value='{{attribute-data.base}}' data-dtype="Number" /><span> +
</span><input type="number" name="data.attributes.{{attribute-key}}.mod" value='{{attribute-data.mod}}'
data-dtype="Number" /><span> =
</span><span class="attribute-value-total">{{attribute-data.total}}</span></div>
</div>
{{/inline}}
{{!--
!-- Render a trait.
!--
!-- @param trait-label: The label to display for the trait
!-- @param trait-key: The key of the trait
!-- @param trait-data: The data for the trait
--}}
{{#*inline "trait"}}
<div class="trait flexrow"><label for="data.traits.strength.total" class="trait-label">{{trait-label}}</label>
<div class="trait-value flex15 grid grid-8col"><input type="number" name="data.traits.{{trait-key}}.base"
value='{{trait-data.base}}' data-dtype="Number" /><span> +
</span><input type="number" name="data.traits.{{trait-key}}.mod" value='{{trait-data.mod}}'
data-dtype="Number" /><span> =
</span><span class="trait-value-total">{{trait-data.total}}</span></div>
</div>
{{/inline}}
{{!-- ======================================================================== --}}
<div class="attributes-traits grid grid-3col">
{{#each config.attributes as |attribute-label attribute-key|}}
{{> attribute attribute-label=attribute-label attribute-key=attribute-key attribute-data=(lookup ../data.attributes
attribute-key)}}
{{/each}}
{{#each config.traits as |trait-label trait-key|}}
{{> trait trait-label=trait-label trait-key=trait-key trait-data=(lookup ../data.traits trait-key)}}
{{/each}}
</div>