Units: add possibility to have an "inverted" time unit, e.g. for charge; add charge units to bike_parking

This commit is contained in:
Pieter Vander Vennet 2024-04-28 23:04:09 +02:00
parent 4ccfe3efe4
commit bf523848fb
8 changed files with 94 additions and 32 deletions

View file

@ -178,7 +178,9 @@
checkedMappings,
tags.data
)
console.log("Constructing change spec from", {freeform: $freeformInput, selectedMapping, checkedMappings, currentTags: tags.data}, " --> ", selectedTags)
if(state.featureSwitches.featureSwitchIsDebugging.data){
console.log("Constructing change spec from", {freeform: $freeformInput, selectedMapping, checkedMappings, currentTags: tags.data}, " --> ", selectedTags)
}
} catch (e) {
console.error("Could not calculate changeSpecification:", e)
selectedTags = undefined

View file

@ -64,10 +64,14 @@
)
</script>
{#if unit.inverted}
<div class="bold px-2">/</div>
{/if}
<select bind:value={$selectedUnit}>
{#each unit.denominations as denom (denom.canonical)}
<option value={denom.canonical}>
{#if $isSingle}
{#if $isSingle || unit.inverted}
<Tr t={denom.humanSingular} />
{:else}
<Tr t={denom.human.Subs({ quantity: "" })} />