diff --git a/src/templates/actor/partials/spells-overview.hbs b/src/templates/actor/partials/spells-overview.hbs index 5338955c..e7e865f7 100644 --- a/src/templates/actor/partials/spells-overview.hbs +++ b/src/templates/actor/partials/spells-overview.hbs @@ -2,25 +2,32 @@ {{!-- INLINE PARTIAL DEFINITIONS --}} {{!-- ======================================================================== --}} - -{{!-- -!-- Two templates for displaying values with unit. +{{!-- +!-- Base template to display a value with unit. !-- @param unitDatum: the object to display; must have a value and a unit attribute !-- @param localizationString -!-- @param config: the config object +!-- @param unitNames: mapping of allowed unitDatum.unit values to localized unit name +!-- @param unitAbbrs: mapping of allowed unitDatum.unit values to unit abbreviation +--}} +{{#*inline "unit"}} +
+ {{#if unitDatum.value }} + {{unitDatum.value}}{{lookup unitAbbrs unitDatum.unit}} + {{else}}-{{/if}} +
+{{/inline}} +{{!-- +!-- Two templates based on the "unit" template for displaying values with unit. +!-- Both accept a `config` object holding the unitNames and unitAbbr instead of +!-- directly handing over the latter two. --}} {{#*inline "temporalUnit"}} -
- {{unitDatum.value}}{{lookup config.temporalUnitsAbbr unitDatum.unit}} -
+{{> unit unitNames=config.temporalUnits unitAbbrs=config.temporalUnitsAbbr unitDatum=unitDatum localizationString=localizationString}} {{/inline}} {{#*inline "distanceUnit"}} -
- {{unitDatum.value}}{{lookup config.distanceUnitsAbbr unitDatum.unit}} -
+{{> unit unitNames=config.distanceUnits unitAbbrs=config.distanceUnitsAbbr unitDatum=unitDatum localizationString=localizationString}} {{/inline}}