fixes to the calculator

This commit is contained in:
2026-10-20 08:32:39 -06:00
parent a9cccf4226
commit 99bf23ecf1
15 changed files with 155 additions and 116 deletions
+2 -2
View File
@@ -49,12 +49,12 @@
{{ $apps := slice }}
{{ range $name := $cfg.apps }}
{{ range $src.apps }}{{ if eq .name $name }}
{{ $apps = $apps | append (dict "name" .name "cost" .cost "perSeat" .perSeat "selected" (in ($cfg.selected | default slice) $name)) }}
{{ $apps = $apps | append (dict "name" .name "cost" .cost "tier" .tier "perSeat" .perSeat "selected" (in ($cfg.selected | default slice) $name)) }}
{{ end }}{{ end }}
{{ end }}
<div class="said-savings">
{{ with $cfg.headline }}<h3 class="said-savings-title">{{ . }}</h3>{{ end }}
{{ partial "savings-calc.html" (dict "key" (printf "%s-savings" (partial "section-id.html" $s)) "apps" $apps "annual" $src.federatedAnnual "compact" true "more" $cfg.more) }}
{{ partial "savings-calc.html" (dict "key" (printf "%s-savings" (partial "section-id.html" $s)) "apps" $apps "plans" $src.federatedPlans "compact" true "more" $cfg.more) }}
</div>
{{ else }}
{{ errorf "quote section: savings.from page %q not found" $cfg.from }}
+3 -3
View File
@@ -1,7 +1,7 @@
{{/*
Savings — an optional bar comparison (`bars`: name, amount, highlight) and
a savings calculator (`apps`: name, cost, perSeat, selected; compared with
`federatedAnnual`), rendered by partials/savings-calc.html.
a savings calculator (`apps`: name, cost, tier, perSeat, selected; compared
with the smallest of `federatedPlans`: name, tier, annual), rendered by partials/savings-calc.html.
*/}}
{{ $s := . }}
{{ $key := partial "section-id.html" $s | default "savings" }}
@@ -26,6 +26,6 @@
{{ end }}
{{ with $s.apps }}
{{ partial "savings-calc.html" (dict "key" $key "apps" . "annual" $s.federatedAnnual "note" $s.calcNote) }}
{{ partial "savings-calc.html" (dict "key" $key "apps" . "plans" $s.federatedPlans "note" $s.calcNote) }}
{{ end }}
{{ if $s.ctas }}<div class="cta-row mt-2">{{ partial "sections/ctas.html" $s.ctas }}</div>{{ end }}